summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2012-02-28 18:35:04 +0000
committerAlasdair Kergon <agk@redhat.com>2012-02-28 18:35:04 +0000
commit7126d8c21b2942f3bda2b64bb6d2195e71ba031f (patch)
treee47a266a7a1dd4ae64a6bbabe68e33168f2b8089
parente980d543710eaebf07c6b5442647463eab47e9d1 (diff)
downloadlvm2-7126d8c21b2942f3bda2b64bb6d2195e71ba031f.tar.gz
lvm2-7126d8c21b2942f3bda2b64bb6d2195e71ba031f.tar.xz
lvm2-7126d8c21b2942f3bda2b64bb6d2195e71ba031f.zip
Reflect new file locations, include file updates etc.
-rw-r--r--Makefile.in12
-rwxr-xr-xconfigure12
-rw-r--r--daemons/Makefile.in12
-rw-r--r--daemons/dmeventd/plugins/lvm2/Makefile.in2
-rw-r--r--daemons/dmeventd/plugins/mirror/Makefile.in2
-rw-r--r--daemons/dmeventd/plugins/snapshot/Makefile.in2
-rw-r--r--daemons/lvmetad/Makefile.in20
-rw-r--r--daemons/lvmetad/lvmetad-client.h9
-rw-r--r--daemons/lvmetad/lvmetad-core.c25
-rw-r--r--lib/Makefile.in8
-rw-r--r--libdaemon/client/daemon-client.c17
-rw-r--r--libdaemon/client/daemon-client.h6
-rw-r--r--libdaemon/client/daemon-shared.c16
-rw-r--r--libdaemon/client/daemon-shared.h26
-rw-r--r--libdaemon/server/daemon-server.c8
-rw-r--r--libdaemon/server/daemon-server.h6
-rw-r--r--make.tmpl.in8
-rw-r--r--tools/Makefile.in4
18 files changed, 141 insertions, 54 deletions
diff --git a/Makefile.in b/Makefile.in
index 9a470a34..72037d23 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -32,10 +32,14 @@ ifeq ("@APPLIB@", "yes")
SUBDIRS += liblvm
endif
+ifeq ("@BUILD_LVMETAD@", "yes")
+ SUBDIRS += libdaemon
+endif
+
# FIXME Should use intermediate Makefiles here!
ifeq ($(MAKECMDGOALS),distclean)
SUBDIRS = doc include man scripts \
- lib tools daemons libdm \
+ libdaemon lib tools daemons libdm \
udev po liblvm test \
unit-tests/datastruct unit-tests/mm unit-tests/regex
endif
@@ -45,10 +49,10 @@ DISTCLEAN_TARGETS += config.cache config.log config.status make.tmpl
include make.tmpl
libdm: include
-lib: libdm
+lib: libdm libdaemon
liblvm: lib
-daemons: lib tools
-tools: lib device-mapper
+daemons: lib libdaemon tools
+tools: lib libdaemon device-mapper
po: tools daemons
lib.device-mapper: include.device-mapper
diff --git a/configure b/configure
index 07902eab..836ad327 100755
--- a/configure
+++ b/configure
@@ -8739,6 +8739,12 @@ $as_echo "$LVMETAD" >&6; }
BUILD_LVMETAD=$LVMETAD
+if test x$BUILD_LVMETAD = xyes; then
+
+$as_echo "#define LVMETAD_SUPPORT 1" >>confdefs.h
+
+fi
+
################################################################################
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable synchronisation with udev processing" >&5
$as_echo_n "checking whether to enable synchronisation with udev processing... " >&6; }
@@ -10426,7 +10432,7 @@ LVM_LIBAPI=`echo "$VER" | $AWK -F '[()]' '{print $2}'`
################################################################################
-ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/cmirrord/Makefile daemons/common/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/lvm2/Makefile daemons/dmeventd/plugins/raid/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile daemons/dmeventd/plugins/thin/Makefile daemons/lvmetad/Makefile doc/Makefile doc/example.conf include/.symlinks include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile lib/mirror/Makefile lib/replicator/Makefile lib/misc/lvm-version.h lib/raid/Makefile lib/snapshot/Makefile lib/thin/Makefile libdm/Makefile libdm/libdevmapper.pc liblvm/Makefile liblvm/liblvm2app.pc man/Makefile po/Makefile scripts/clvmd_init_red_hat scripts/cmirrord_init_red_hat scripts/lvm2_lvmetad_init_red_hat scripts/lvm2_lvmetad_systemd_red_hat.socket scripts/lvm2_lvmetad_systemd_red_hat.service scripts/lvm2_monitoring_init_red_hat scripts/dm_event_systemd_red_hat.service scripts/lvm2_monitoring_systemd_red_hat.service scripts/lvm2_tmpfiles_red_hat.conf scripts/Makefile test/Makefile test/api/Makefile test/unit/Makefile tools/Makefile udev/Makefile unit-tests/datastruct/Makefile unit-tests/regex/Makefile unit-tests/mm/Makefile"
+ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/cmirrord/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/lvm2/Makefile daemons/dmeventd/plugins/raid/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile daemons/dmeventd/plugins/thin/Makefile daemons/lvmetad/Makefile doc/Makefile doc/example.conf include/.symlinks include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile lib/mirror/Makefile lib/replicator/Makefile lib/misc/lvm-version.h lib/raid/Makefile lib/snapshot/Makefile lib/thin/Makefile libdaemon/Makefile libdaemon/client/Makefile libdaemon/server/Makefile libdm/Makefile libdm/libdevmapper.pc liblvm/Makefile liblvm/liblvm2app.pc man/Makefile po/Makefile scripts/clvmd_init_red_hat scripts/cmirrord_init_red_hat scripts/lvm2_lvmetad_init_red_hat scripts/lvm2_lvmetad_systemd_red_hat.socket scripts/lvm2_lvmetad_systemd_red_hat.service scripts/lvm2_monitoring_init_red_hat scripts/dm_event_systemd_red_hat.service scripts/lvm2_monitoring_systemd_red_hat.service scripts/lvm2_tmpfiles_red_hat.conf scripts/Makefile test/Makefile test/api/Makefile test/unit/Makefile tools/Makefile udev/Makefile unit-tests/datastruct/Makefile unit-tests/regex/Makefile unit-tests/mm/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -11120,7 +11126,6 @@ do
"daemons/Makefile") CONFIG_FILES="$CONFIG_FILES daemons/Makefile" ;;
"daemons/clvmd/Makefile") CONFIG_FILES="$CONFIG_FILES daemons/clvmd/Makefile" ;;
"daemons/cmirrord/Makefile") CONFIG_FILES="$CONFIG_FILES daemons/cmirrord/Makefile" ;;
- "daemons/common/Makefile") CONFIG_FILES="$CONFIG_FILES daemons/common/Makefile" ;;
"daemons/dmeventd/Makefile") CONFIG_FILES="$CONFIG_FILES daemons/dmeventd/Makefile" ;;
"daemons/dmeventd/libdevmapper-event.pc") CONFIG_FILES="$CONFIG_FILES daemons/dmeventd/libdevmapper-event.pc" ;;
"daemons/dmeventd/plugins/Makefile") CONFIG_FILES="$CONFIG_FILES daemons/dmeventd/plugins/Makefile" ;;
@@ -11144,6 +11149,9 @@ do
"lib/raid/Makefile") CONFIG_FILES="$CONFIG_FILES lib/raid/Makefile" ;;
"lib/snapshot/Makefile") CONFIG_FILES="$CONFIG_FILES lib/snapshot/Makefile" ;;
"lib/thin/Makefile") CONFIG_FILES="$CONFIG_FILES lib/thin/Makefile" ;;
+ "libdaemon/Makefile") CONFIG_FILES="$CONFIG_FILES libdaemon/Makefile" ;;
+ "libdaemon/client/Makefile") CONFIG_FILES="$CONFIG_FILES libdaemon/client/Makefile" ;;
+ "libdaemon/server/Makefile") CONFIG_FILES="$CONFIG_FILES libdaemon/server/Makefile" ;;
"libdm/Makefile") CONFIG_FILES="$CONFIG_FILES libdm/Makefile" ;;
"libdm/libdevmapper.pc") CONFIG_FILES="$CONFIG_FILES libdm/libdevmapper.pc" ;;
"liblvm/Makefile") CONFIG_FILES="$CONFIG_FILES liblvm/Makefile" ;;
diff --git a/daemons/Makefile.in b/daemons/Makefile.in
index 37d83580..c83e0da0 100644
--- a/daemons/Makefile.in
+++ b/daemons/Makefile.in
@@ -15,13 +15,11 @@ srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
-SUBDIRS += common
-
ifeq ("@BUILD_LVMETAD@", "yes")
SUBDIRS += lvmetad
endif
-.PHONY: dmeventd clvmd common cmirrord lvmetad
+.PHONY: dmeventd clvmd cmirrord lvmetad
ifneq ("@CLVMD@", "none")
SUBDIRS += clvmd
@@ -39,7 +37,7 @@ endif
endif
ifeq ($(MAKECMDGOALS),distclean)
- SUBDIRS = clvmd cmirrord common dmeventd lvmetad
+ SUBDIRS = clvmd cmirrord dmeventd lvmetad
endif
include $(top_builddir)/make.tmpl
@@ -47,9 +45,3 @@ include $(top_builddir)/make.tmpl
ifeq ("@BUILD_DMEVENTD@", "yes")
device-mapper: dmeventd.device-mapper
endif
-
-ifeq ("@BUILD_LVMETAD@", "yes")
-lvmetad: common.device-mapper
-endif
-
-device-mapper: common.device-mapper
diff --git a/daemons/dmeventd/plugins/lvm2/Makefile.in b/daemons/dmeventd/plugins/lvm2/Makefile.in
index 77bc15cc..fcb2a0a8 100644
--- a/daemons/dmeventd/plugins/lvm2/Makefile.in
+++ b/daemons/dmeventd/plugins/lvm2/Makefile.in
@@ -24,7 +24,7 @@ LIB_VERSION = $(LIB_VERSION_LVM)
include $(top_builddir)/make.tmpl
-LIBS += @LVM2CMD_LIB@ -ldevmapper $(PTHREAD_LIBS) -L$(top_builddir)/daemons/common -ldaemon
+LIBS += @LVM2CMD_LIB@ -ldevmapper $(PTHREAD_LIBS) $(DAEMON_LIBS)
install_lvm2: install_lib_shared
diff --git a/daemons/dmeventd/plugins/mirror/Makefile.in b/daemons/dmeventd/plugins/mirror/Makefile.in
index 424c4859..85b33c93 100644
--- a/daemons/dmeventd/plugins/mirror/Makefile.in
+++ b/daemons/dmeventd/plugins/mirror/Makefile.in
@@ -30,7 +30,7 @@ CFLOW_LIST_TARGET = $(LIB_NAME).cflow
include $(top_builddir)/make.tmpl
-LIBS += -ldevmapper-event-lvm2 -ldevmapper -L$(top_builddir)/daemons/common -ldaemon
+LIBS += -ldevmapper-event-lvm2 -ldevmapper $(DAEMON_LIBS)
install_lvm2: install_dm_plugin
diff --git a/daemons/dmeventd/plugins/snapshot/Makefile.in b/daemons/dmeventd/plugins/snapshot/Makefile.in
index 3d731e56..a4cff15f 100644
--- a/daemons/dmeventd/plugins/snapshot/Makefile.in
+++ b/daemons/dmeventd/plugins/snapshot/Makefile.in
@@ -26,7 +26,7 @@ LIB_VERSION = $(LIB_VERSION_LVM)
include $(top_builddir)/make.tmpl
-LIBS += -ldevmapper-event-lvm2 -ldevmapper -L$(top_builddir)/daemons/common -ldaemon
+LIBS += -ldevmapper-event-lvm2 -ldevmapper $(DAEMON_LIBS)
install_lvm2: install_dm_plugin
diff --git a/daemons/lvmetad/Makefile.in b/daemons/lvmetad/Makefile.in
index 9600a1fd..35aa4ab6 100644
--- a/daemons/lvmetad/Makefile.in
+++ b/daemons/lvmetad/Makefile.in
@@ -1,6 +1,7 @@
-# Copyright (C) 2011 Red Hat, Inc. All rights reserved.
#
-# This file is part of the device-mapper userspace tools.
+# Copyright (C) 2011-2012 Red Hat, Inc.
+#
+# This file is part of LVM2.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
@@ -21,18 +22,23 @@ TARGETS = lvmetad lvmetad-testclient
.PHONY: install_lvmetad
-INCLUDES += -I$(top_srcdir)/daemons/common
-
CFLOW_LIST = $(SOURCES)
CFLOW_LIST_TARGET = $(LIB_NAME).cflow
CFLOW_TARGET = lvmetad
include $(top_builddir)/make.tmpl
-LIBS += -ldevmapper -ldaemon $(PTHREAD_LIBS)
+INCLUDES += -I$(top_srcdir)/libdaemon/server
+LVMLIBS = -ldaemonserver $(LVMINTERNAL_LIBS) -ldevmapper
+
+LIBS += $(PTHREAD_LIBS)
+
+LDFLAGS += -L$(top_builddir)/libdaemon/server
+CLDFLAGS += -L$(top_builddir)/libdaemon/server
-lvmetad: lvmetad-core.o
- $(CC) $(CFLAGS) $(LDFLAGS) -L$(top_builddir)/daemons/common -o $@ lvmetad-core.o \
+lvmetad: $(OBJECTS) $(top_builddir)/libdaemon/client/libdaemonclient.a \
+ $(top_builddir)/libdaemon/server/libdaemonserver.a
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) \
$(DL_LIBS) $(LVMLIBS) $(LIBS) -rdynamic
# TODO: No idea. No idea how to test either.
diff --git a/daemons/lvmetad/lvmetad-client.h b/daemons/lvmetad/lvmetad-client.h
index cebfb048..fe8eedcc 100644
--- a/daemons/lvmetad/lvmetad-client.h
+++ b/daemons/lvmetad/lvmetad-client.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2011-2012 Red Hat, Inc.
*
* This file is part of LVM2.
*
@@ -16,7 +16,8 @@
#define _LVM_LVMETAD_CLIENT_H
#include "daemon-client.h"
-#include "metadata-exported.h"
+
+struct volume_group;
/* Different types of replies we may get from lvmetad. */
@@ -44,7 +45,7 @@ daemon_reply lvmetad_add_pv(daemon_handle h, const char *pv_uuid, const char *md
daemon_reply lvmetad_remove_pv(daemon_handle h, const char *pv_uuid);
/* Trigger a full disk scan, throwing away all caches. XXX do we eventually want
- * this? Probalby not yet, anyway.
+ * this? Probably not yet, anyway.
* daemon_reply lvmetad_rescan(daemon_handle h);
*/
@@ -57,7 +58,7 @@ daemon_reply lvmetad_remove_pv(daemon_handle h, const char *pv_uuid);
*/
daemon_reply lvmetad_supersede_vg(daemon_handle h, struct volume_group *vg);
-/* Implementation of inline functions */
+/* Wrappers to open/close connection */
static inline daemon_handle lvmetad_open(const char *socket)
{
diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c
index f53478b6..f3fc2d05 100644
--- a/daemons/lvmetad/lvmetad-core.c
+++ b/daemons/lvmetad/lvmetad-core.c
@@ -1,16 +1,29 @@
-#define _GNU_SOURCE
+/*
+ * Copyright (C) 2012 Red Hat, Inc.
+ *
+ * This file is part of LVM2.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License v.2.1.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
#define _XOPEN_SOURCE 500 /* pthread */
+#include "configure.h"
+#include "daemon-shared.h"
+#include "daemon-server.h"
+
#include <assert.h>
#include <pthread.h>
#include <malloc.h>
#include <stdint.h>
#include <unistd.h>
-#include "configure.h"
-#include "libdevmapper.h"
-#include "daemon-server.h"
-
typedef struct {
struct dm_hash_table *pvid_to_pvmeta;
struct dm_hash_table *device_to_pvid; /* shares locks with above */
@@ -196,6 +209,7 @@ static struct dm_config_node *make_text_node(struct dm_config_tree *cft,
return cn;
}
+#if 0
static struct dm_config_node *make_int_node(struct dm_config_tree *cft,
const char *key,
int64_t value,
@@ -208,6 +222,7 @@ static struct dm_config_node *make_int_node(struct dm_config_tree *cft,
cn->v->v.i = value;
return cn;
}
+#endif
static void filter_metadata(struct dm_config_node *vg) {
struct dm_config_node *pv = pvs(vg);
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 9509db3a..5252658e 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -16,8 +16,6 @@ srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
-INCLUDES += -I$(top_srcdir)/daemons/common -I$(top_srcdir)/daemons/lvmetad
-
ifeq ("@LVM1@", "shared")
SUBDIRS = format1
endif
@@ -48,7 +46,6 @@ endif
SOURCES =\
activate/activate.c \
- cache/lvmetad.c \
cache/lvmcache.c \
commands/toolcontext.c \
config/config.c \
@@ -178,6 +175,11 @@ ifeq ("@HAVE_LIBDL@", "yes")
misc/sharedlib.c
endif
+ifeq ("@BUILD_LVMETAD@", "yes")
+ SOURCES +=\
+ cache/lvmetad.c
+endif
+
ifeq ("@DMEVENTD@", "yes")
CLDFLAGS += -L$(top_builddir)/daemons/dmeventd
LIBS += -ldevmapper-event
diff --git a/libdaemon/client/daemon-client.c b/libdaemon/client/daemon-client.c
index 558f770e..3b336a32 100644
--- a/libdaemon/client/daemon-client.c
+++ b/libdaemon/client/daemon-client.c
@@ -1,5 +1,20 @@
-#include "daemon-client.h"
+/*
+ * Copyright (C) 2011-2012 Red Hat, Inc.
+ *
+ * This file is part of LVM2.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License v.2.1.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
#include "daemon-shared.h"
+#include "daemon-client.h"
+
#include <sys/un.h>
#include <sys/socket.h>
#include <string.h>
diff --git a/libdaemon/client/daemon-client.h b/libdaemon/client/daemon-client.h
index 9f99fcfb..7b2a8067 100644
--- a/libdaemon/client/daemon-client.h
+++ b/libdaemon/client/daemon-client.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2011-2012 Red Hat, Inc.
*
* This file is part of LVM2.
*
@@ -12,11 +12,11 @@
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "libdevmapper.h" // for dm_list, needed by config.h
-
#ifndef _LVM_DAEMON_COMMON_CLIENT_H
#define _LVM_DAEMON_COMMON_CLIENT_H
+#include "libdevmapper.h"
+
typedef struct {
int socket_fd; /* the fd we use to talk to the daemon */
const char *protocol;
diff --git a/libdaemon/client/daemon-shared.c b/libdaemon/client/daemon-shared.c
index 5301d2f9..33ff48f7 100644
--- a/libdaemon/client/daemon-shared.c
+++ b/libdaemon/client/daemon-shared.c
@@ -1,10 +1,26 @@
+/*
+ * Copyright (C) 2011-2012 Red Hat, Inc.
+ *
+ * This file is part of LVM2.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License v.2.1.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
#include <errno.h>
#include <stdio.h>
#include <malloc.h>
#include <string.h>
#include <unistd.h>
#include <assert.h>
+
#include "daemon-shared.h"
+#include "libdevmapper.h"
/*
* Read a single message from a (socket) filedescriptor. Messages are delimited
diff --git a/libdaemon/client/daemon-shared.h b/libdaemon/client/daemon-shared.h
index a15e6fdd..3e5fa9cb 100644
--- a/libdaemon/client/daemon-shared.h
+++ b/libdaemon/client/daemon-shared.h
@@ -1,6 +1,30 @@
+/*
+ * Copyright (C) 2011-2012 Red Hat, Inc.
+ *
+ * This file is part of LVM2.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License v.2.1.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _LVM_DAEMON_SHARED_H
+#define _LVM_DAEMON_SHARED_H
+
+#include "configure.h"
+
+#define _REENTRANT
+#define _GNU_SOURCE
+#define _FILE_OFFSET_BITS 64
+
#include <stdarg.h>
-#include <libdevmapper.h>
int read_buffer(int fd, char **buffer);
int write_buffer(int fd, const char *buffer, int length);
char *format_buffer(const char *what, const char *id, va_list ap);
+
+#endif /* _LVM_DAEMON_SHARED_H */
diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
index c2ba7f34..2188afe9 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2011-2012 Red Hat, Inc.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
@@ -10,6 +10,9 @@
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include "daemon-shared.h"
+#include "daemon-server.h"
+
#include <dlfcn.h>
#include <errno.h>
#include <pthread.h>
@@ -24,9 +27,6 @@
#include <signal.h>
#include <syslog.h>
-#include "daemon-server.h"
-#include "daemon-shared.h"
-#include "libdevmapper.h"
#if 0
/* Create a device monitoring thread. */
diff --git a/libdaemon/server/daemon-server.h b/libdaemon/server/daemon-server.h
index 79907bdb..104dac17 100644
--- a/libdaemon/server/daemon-server.h
+++ b/libdaemon/server/daemon-server.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2011-2012 Red Hat, Inc.
*
* This file is part of LVM2.
*
@@ -12,11 +12,11 @@
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "daemon-client.h"
-
#ifndef _LVM_DAEMON_COMMON_SERVER_H
#define _LVM_DAEMON_COMMON_SERVER_H
+#include "daemon-client.h"
+
typedef struct {
int socket_fd; /* the fd we use to talk to the client */
pthread_t thread_id;
diff --git a/make.tmpl.in b/make.tmpl.in
index a4304e0d..c729080c 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -39,7 +39,7 @@ ELDFLAGS += @ELDFLAGS@
LDDEPS += @LDDEPS@
LDFLAGS += @LDFLAGS@
LIB_SUFFIX = @LIB_SUFFIX@
-LVMINTERNAL_LIBS = -llvm-internal -L$(top_builddir)/daemons/common -ldaemon $(UDEV_LIBS) $(DL_LIBS)
+LVMINTERNAL_LIBS = -llvm-internal $(DAEMON_LIBS) $(UDEV_LIBS) $(DL_LIBS)
DL_LIBS = @DL_LIBS@
PTHREAD_LIBS = @PTHREAD_LIBS@
READLINE_LIBS = @READLINE_LIBS@
@@ -143,6 +143,12 @@ endif
LDFLAGS += -L$(top_builddir)/libdm -L$(top_builddir)/lib
CLDFLAGS += -L$(top_builddir)/libdm -L$(top_builddir)/lib
+ifeq ("@BUILD_LVMETAD@", "yes")
+ DAEMON_LIBS = -ldaemonclient
+ LDFLAGS += -L$(top_builddir)/libdaemon/client
+ CLDFLAGS += -L$(top_builddir)/libdaemon/client
+endif
+
ifeq ("@DMEVENTD@", "yes")
LDFLAGS += -L$(top_builddir)/daemons/dmeventd
CLDFLAGS += -L$(top_builddir)/daemons/dmeventd
diff --git a/tools/Makefile.in b/tools/Makefile.in
index c17abf74..15843f0e 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -1,6 +1,6 @@
#
# Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
-# Copyright (C) 2004-2011 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2004-2012 Red Hat, Inc. All rights reserved.
#
# This file is part of LVM2.
#
@@ -16,8 +16,6 @@ srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
-INCLUDES += -I$(top_srcdir)/daemons/common -I$(top_srcdir)/daemons/lvmetad
-
SOURCES =\
dumpconfig.c \
formats.c \