master - makefiles: sort
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d76b4afb8ed9531c160...
Commit: d76b4afb8ed9531c1609804b684900a0ea96815c
Parent: a8cdd9e16a04ca837401cbcaa4677b2af50007b7
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Dec 14 21:50:09 2018 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Dec 17 10:36:52 2018 +0100
makefiles: sort
---
base/Makefile | 4 ++--
daemons/lvmdbusd/Makefile.in | 6 +++---
device_mapper/Makefile | 6 +++---
test/unit/Makefile | 4 ++--
tools/Makefile.in | 4 ++--
5 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/base/Makefile b/base/Makefile
index f150ad9..6050c3a 100644
--- a/base/Makefile
+++ b/base/Makefile
@@ -18,9 +18,9 @@
# which defined all top_* variables
BASE_SOURCE=\
- base/data-struct/radix-tree.c \
base/data-struct/hash.c \
- base/data-struct/list.c
+ base/data-struct/list.c \
+ base/data-struct/radix-tree.c
BASE_DEPENDS = $(BASE_SOURCE:%.c=%.d)
BASE_OBJECTS = $(BASE_SOURCE:%.c=%.o)
diff --git a/daemons/lvmdbusd/Makefile.in b/daemons/lvmdbusd/Makefile.in
index 8d5de28..da96c34 100644
--- a/daemons/lvmdbusd/Makefile.in
+++ b/daemons/lvmdbusd/Makefile.in
@@ -23,11 +23,10 @@ LVMDBUS_SRCDIR_FILES = \
cfg.py \
cmdhandler.py \
fetch.py \
- __init__.py \
job.py \
loader.py \
- main.py \
lv.py \
+ main.py \
manager.py \
objectmanager.py \
pv.py \
@@ -35,7 +34,8 @@ LVMDBUS_SRCDIR_FILES = \
state.py \
udevwatch.py \
utils.py \
- vg.py
+ vg.py \
+ __init__.py
LVMDBUS_BUILDDIR_FILES = \
lvmdb.py \
diff --git a/device_mapper/Makefile b/device_mapper/Makefile
index bb0880d..fd2189a 100644
--- a/device_mapper/Makefile
+++ b/device_mapper/Makefile
@@ -15,6 +15,7 @@
DEVICE_MAPPER_SOURCE=\
device_mapper/datastruct/bitset.c \
+ device_mapper/ioctl/libdm-iface.c \
device_mapper/libdm-common.c \
device_mapper/libdm-config.c \
device_mapper/libdm-deptree.c \
@@ -27,9 +28,8 @@ DEVICE_MAPPER_SOURCE=\
device_mapper/regex/matcher.c \
device_mapper/regex/parse_rx.c \
device_mapper/regex/ttree.c \
- device_mapper/ioctl/libdm-iface.c \
- device_mapper/vdo/vdo_target.c \
- device_mapper/vdo/status.c
+ device_mapper/vdo/status.c \
+ device_mapper/vdo/vdo_target.c
DEVICE_MAPPER_DEPENDS = $(DEVICE_MAPPER_SOURCE:%.c=%.d)
DEVICE_MAPPER_OBJECTS = $(DEVICE_MAPPER_SOURCE:%.c=%.o)
diff --git a/test/unit/Makefile b/test/unit/Makefile
index fa6acb6..5b71e1b 100644
--- a/test/unit/Makefile
+++ b/test/unit/Makefile
@@ -20,11 +20,11 @@ UNIT_SOURCE=\
test/unit/config_t.c \
test/unit/dmlist_t.c \
test/unit/dmstatus_t.c \
+ test/unit/framework.c \
test/unit/io_engine_t.c \
- test/unit/radix_tree_t.c \
test/unit/matcher_t.c \
- test/unit/framework.c \
test/unit/percent_t.c \
+ test/unit/radix_tree_t.c \
test/unit/run.c \
test/unit/string_t.c \
test/unit/vdo_t.c
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 7b29517..09768ed 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -28,6 +28,7 @@ SOURCES =\
lvextend.c \
lvmcmdline.c \
lvmdiskscan.c \
+ lvpoll.c \
lvreduce.c \
lvremove.c \
lvrename.c \
@@ -56,10 +57,9 @@ SOURCES =\
vgexport.c \
vgextend.c \
vgimport.c \
+ vgimportclone.c \
vgmerge.c \
vgmknodes.c \
- lvpoll.c \
- vgimportclone.c \
vgreduce.c \
vgremove.c \
vgrename.c \
5 years, 4 months
master - cmirror: link with libdm
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a8cdd9e16a04ca83740...
Commit: a8cdd9e16a04ca837401cbcaa4677b2af50007b7
Parent: 701ecff0ff2c1a3d194a6d94b16b9ce6f0a2ba22
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Dec 14 22:17:08 2018 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Dec 17 10:36:52 2018 +0100
cmirror: link with libdm
Since there is very little change there will be any new devel going
to happing with cmirror - avoid eating extra disk space and link
with already installed libdm which implements all use basic
function of dm list
---
daemons/cmirrord/Makefile.in | 4 ++--
daemons/cmirrord/cluster.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/daemons/cmirrord/Makefile.in b/daemons/cmirrord/Makefile.in
index 0bcd73c..ff45225 100644
--- a/daemons/cmirrord/Makefile.in
+++ b/daemons/cmirrord/Makefile.in
@@ -28,10 +28,10 @@ LMLIBS += $(CPG_LIBS)
CFLAGS += $(CPG_CFLAGS) $(EXTRA_EXEC_CFLAGS)
LDFLAGS += $(EXTRA_EXEC_LDFLAGS) $(ELDFLAGS)
-cmirrord: $(OBJECTS) $(top_builddir)/lib/liblvm-internal.a
+cmirrord: $(OBJECTS)
@echo " [CC] $@"
$(Q) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) \
- $(LVMLIBS) $(LMLIBS) $(INTERNAL_LIBS) $(LIBS)
+ $(LMLIBS) -L$(top_builddir)/libdm -ldevmapper $(LIBS)
install: $(TARGETS)
@echo " [INSTALL] $<"
diff --git a/daemons/cmirrord/cluster.h b/daemons/cmirrord/cluster.h
index 01d4871..0efbd64 100644
--- a/daemons/cmirrord/cluster.h
+++ b/daemons/cmirrord/cluster.h
@@ -12,8 +12,8 @@
#ifndef _LVM_CLOG_CLUSTER_H
#define _LVM_CLOG_CLUSTER_H
-#include "device_mapper/misc/dm-log-userspace.h"
-#include "device_mapper/all.h"
+#include "libdm/misc/dm-log-userspace.h"
+#include "libdm/libdevmapper.h"
#define DM_ULOG_RESPONSE 0x1000U /* in last byte of 32-bit value */
#define DM_ULOG_CHECKPOINT_READY 21
5 years, 4 months
master - lvm: drop usage of dl library
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=701ecff0ff2c1a3d194...
Commit: 701ecff0ff2c1a3d194a6d94b16b9ce6f0a2ba22
Parent: 8bf445b2deed25f101e2861656ee19151ea7e335
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Dec 14 21:51:11 2018 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Dec 17 10:36:52 2018 +0100
lvm: drop usage of dl library
Since lvm no longer supports any dlopen-able plugins
(which in practice was never really usable) drop linking
with -ldl.
---
lib/Makefile.in | 11 +-----
lib/commands/toolcontext.c | 93 --------------------------------------------
lib/misc/sharedlib.c | 30 +--------------
lib/misc/sharedlib.h | 3 -
make.tmpl.in | 2 +-
test/unit/Makefile | 2 +-
6 files changed, 4 insertions(+), 137 deletions(-)
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 722e954..bde66f9 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -91,6 +91,7 @@ SOURCES =\
misc/lvm-string.c \
misc/lvm-wrappers.c \
misc/lvm-percent.c \
+ misc/sharedlib.c \
mm/memlock.c \
notify/lvmnotify.c \
properties/prop_common.c \
@@ -109,10 +110,6 @@ ifeq ("@DEVMAPPER@", "yes")
activate/fs.c
endif
-ifeq ("@HAVE_LIBDL@", "yes")
- SOURCES += misc/sharedlib.c
-endif
-
ifeq ("@BUILD_LVMPOLLD@", "yes")
SOURCES +=\
lvmpolld/lvmpolld-client.c
@@ -130,12 +127,6 @@ endif
LIB_NAME = liblvm-internal
LIB_STATIC = $(LIB_NAME).a
-ifeq ($(MAKECMDGOALS),distclean)
- SUBDIRS =\
- notify \
- locking
-endif
-
CFLOW_LIST = $(SOURCES)
CFLOW_LIST_TARGET = $(LIB_NAME).cflow
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index c42ed56..63eafe8 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -32,10 +32,6 @@
#include "lib/format_text/archiver.h"
#include "lib/lvmpolld/lvmpolld-client.h"
-#ifdef HAVE_LIBDL
-#include "lib/misc/sharedlib.h"
-#endif
-
#include <locale.h>
#include <sys/stat.h>
#include <sys/syscall.h>
@@ -1276,24 +1272,6 @@ int lvm_register_segtype(struct segtype_library *seglib,
return 1;
}
-static int _init_single_segtype(struct cmd_context *cmd,
- struct segtype_library *seglib)
-{
- struct segment_type *(*init_segtype_fn) (struct cmd_context *);
- struct segment_type *segtype;
-
- if (!(init_segtype_fn = dlsym(seglib->lib, "init_segtype"))) {
- log_error("Shared library %s does not contain segment type "
- "functions", seglib->libname);
- return 0;
- }
-
- if (!(segtype = init_segtype_fn(seglib->cmd)))
- return_0;
-
- return lvm_register_segtype(seglib, segtype);
-}
-
static int _init_segtypes(struct cmd_context *cmd)
{
int i;
@@ -1314,10 +1292,6 @@ static int _init_segtypes(struct cmd_context *cmd)
NULL
};
-#ifdef HAVE_LIBDL
- const struct dm_config_node *cn;
-#endif
-
for (i = 0; init_segtype_array[i]; i++) {
if (!(segtype = init_segtype_array[i](cmd)))
return 0;
@@ -1350,57 +1324,6 @@ static int _init_segtypes(struct cmd_context *cmd)
return 0;
#endif
-#ifdef HAVE_LIBDL
- /* Load any formats in shared libs unless static */
- if (!is_static() &&
- (cn = find_config_tree_array(cmd, global_segment_libraries_CFG, NULL))) {
-
- const struct dm_config_value *cv;
- int (*init_multiple_segtypes_fn) (struct cmd_context *,
- struct segtype_library *);
-
- for (cv = cn->v; cv; cv = cv->next) {
- if (cv->type != DM_CFG_STRING) {
- log_error("Invalid string in config file: "
- "global/segment_libraries");
- return 0;
- }
- seglib.libname = cv->v.str;
- if (!(seglib.lib = load_shared_library(cmd,
- seglib.libname,
- "segment type", 0)))
- return_0;
-
- if ((init_multiple_segtypes_fn =
- dlsym(seglib.lib, "init_multiple_segtypes"))) {
- if (dlsym(seglib.lib, "init_segtype"))
- log_warn("WARNING: Shared lib %s has "
- "conflicting init fns. Using"
- " init_multiple_segtypes().",
- seglib.libname);
- } else
- init_multiple_segtypes_fn =
- _init_single_segtype;
-
- if (!init_multiple_segtypes_fn(cmd, &seglib)) {
- struct dm_list *sgtl, *tmp;
- log_error("init_multiple_segtypes() failed: "
- "Unloading shared library %s",
- seglib.libname);
- dm_list_iterate_safe(sgtl, tmp, &cmd->segtypes) {
- segtype = dm_list_item(sgtl, struct segment_type);
- if (segtype->library == seglib.lib) {
- dm_list_del(&segtype->list);
- segtype->ops->destroy(segtype);
- }
- }
- dlclose(seglib.lib);
- return_0;
- }
- }
- }
-#endif
-
return 1;
}
@@ -1797,27 +1720,11 @@ static void _destroy_segtypes(struct dm_list *segtypes)
{
struct dm_list *sgtl, *tmp;
struct segment_type *segtype;
- void *lib;
dm_list_iterate_safe(sgtl, tmp, segtypes) {
segtype = dm_list_item(sgtl, struct segment_type);
dm_list_del(&segtype->list);
- lib = segtype->library;
segtype->ops->destroy(segtype);
-#ifdef HAVE_LIBDL
- /*
- * If no segtypes remain from this library, close it.
- */
- if (lib) {
- struct segment_type *segtype2;
- dm_list_iterate_items(segtype2, segtypes)
- if (segtype2->library == lib)
- goto skip_dlclose;
- dlclose(lib);
-skip_dlclose:
- ;
- }
-#endif
}
}
diff --git a/lib/misc/sharedlib.c b/lib/misc/sharedlib.c
index 4c2d5d9..544bb5f 100644
--- a/lib/misc/sharedlib.c
+++ b/lib/misc/sharedlib.c
@@ -14,8 +14,8 @@
*/
#include "lib/misc/lib.h"
+#include "sharedlib.h"
#include "lib/config/config.h"
-#include "lib/misc/sharedlib.h"
#include "lib/commands/toolcontext.h"
#include <limits.h>
@@ -40,31 +40,3 @@ void get_shared_library_path(struct cmd_context *cmd, const char *libname,
(void) dm_strncpy(path, libname, path_len);
}
}
-
-void *load_shared_library(struct cmd_context *cmd, const char *libname,
- const char *desc, int silent)
-{
- char path[PATH_MAX];
- void *library;
-
- if (is_static()) {
- log_error("Not loading shared %s library %s in static mode.",
- desc, libname);
- return NULL;
- }
-
- get_shared_library_path(cmd, libname, path, sizeof(path));
-
- log_very_verbose("Opening shared %s library %s", desc, path);
-
- if (!(library = dlopen(path, RTLD_LAZY | RTLD_GLOBAL))) {
- if (silent)
- log_verbose("Unable to open external %s library %s: %s",
- desc, path, dlerror());
- else
- log_error("Unable to open external %s library %s: %s",
- desc, path, dlerror());
- }
-
- return library;
-}
diff --git a/lib/misc/sharedlib.h b/lib/misc/sharedlib.h
index 5ff2dcb..23f2acc 100644
--- a/lib/misc/sharedlib.h
+++ b/lib/misc/sharedlib.h
@@ -21,7 +21,4 @@
void get_shared_library_path(struct cmd_context *cmd, const char *libname,
char *path, size_t path_len);
-void *load_shared_library(struct cmd_context *cmd, const char *libname,
- const char *what, int silent);
-
#endif
diff --git a/make.tmpl.in b/make.tmpl.in
index 1a101fc..13f9afc 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -75,7 +75,7 @@ LDDEPS += @LDDEPS@
LIB_SUFFIX = @LIB_SUFFIX@
LVMINTERNAL_LIBS=\
-llvm-internal \
- $(DMEVENT_LIBS) $(DAEMON_LIBS) $(SYSTEMD_LIBS) $(UDEV_LIBS) $(DL_LIBS) $(BLKID_LIBS)
+ $(DAEMON_LIBS) $(DMEVENT_LIBS) $(SYSTEMD_LIBS) $(UDEV_LIBS) $(BLKID_LIBS)
DL_LIBS = @DL_LIBS@
RT_LIBS = @RT_LIBS@
M_LIBS = @M_LIBS@
diff --git a/test/unit/Makefile b/test/unit/Makefile
index 0ba98ee..fa6acb6 100644
--- a/test/unit/Makefile
+++ b/test/unit/Makefile
@@ -41,7 +41,7 @@ CLEAN_TARGETS += $(UNIT_DEPENDS) $(UNIT_OBJECTS) \
test/unit/unit-test: $(UNIT_OBJECTS) lib/liblvm-internal.a libdaemon/client/libdaemonclient.a $(INTERNAL_LIBS)
@echo " [LD] $@"
$(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_EXEC_LDFLAGS) \
- -o $@ $+ $(DMEVENT_LIBS) $(SYSTEMD_LIBS) $(LIBS) -ldl -laio
+ -o $@ $+ $(DMEVENT_LIBS) $(SYSTEMD_LIBS) $(LIBS) -laio
.PHONEY: run-unit-test unit-test
unit-test: test/unit/unit-test
5 years, 4 months
master - dmeventd: do not link internal libraries to plugins
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=8bf445b2deed25f101e...
Commit: 8bf445b2deed25f101e2861656ee19151ea7e335
Parent: 035a7b9a4bf77798d9d7ecdb7cfa8dfd77a92729
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Dec 14 16:58:56 2018 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Dec 17 10:36:52 2018 +0100
dmeventd: do not link internal libraries to plugins
Avoid linking internal device-mapper and link dynamically libdevmapper.
This considerably reduced size of installed binaries.
---
daemons/dmeventd/plugins/lvm2/Makefile.in | 3 +--
daemons/dmeventd/plugins/mirror/Makefile.in | 3 +--
daemons/dmeventd/plugins/raid/Makefile.in | 3 +--
daemons/dmeventd/plugins/snapshot/Makefile.in | 3 +--
daemons/dmeventd/plugins/thin/Makefile.in | 3 +--
daemons/dmeventd/plugins/vdo/Makefile.in | 3 +--
6 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/daemons/dmeventd/plugins/lvm2/Makefile.in b/daemons/dmeventd/plugins/lvm2/Makefile.in
index e4eedc6..858de9d 100644
--- a/daemons/dmeventd/plugins/lvm2/Makefile.in
+++ b/daemons/dmeventd/plugins/lvm2/Makefile.in
@@ -16,6 +16,7 @@ top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
CLDFLAGS += -L$(top_builddir)/tools
+LIBS += $(DMEVENT_LIBS) $(PTHREAD_LIBS) @LVM2CMD_LIB@
SOURCES = dmeventd_lvm.c
@@ -24,8 +25,6 @@ LIB_VERSION = $(LIB_VERSION_LVM)
include $(top_builddir)/make.tmpl
-LIBS += @LVM2CMD_LIB@ $(INTERNAL_LIBS) $(PTHREAD_LIBS)
-
install_lvm2: install_lib_shared
install: install_lvm2
diff --git a/daemons/dmeventd/plugins/mirror/Makefile.in b/daemons/dmeventd/plugins/mirror/Makefile.in
index 2c0d5d7..62d94c9 100644
--- a/daemons/dmeventd/plugins/mirror/Makefile.in
+++ b/daemons/dmeventd/plugins/mirror/Makefile.in
@@ -17,6 +17,7 @@ top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
CLDFLAGS += -L$(top_builddir)/daemons/dmeventd/plugins/lvm2
+LIBS += -ldevmapper-event-lvm2
SOURCES = dmeventd_mirror.c
@@ -29,8 +30,6 @@ CFLOW_LIST_TARGET = $(LIB_NAME).cflow
include $(top_builddir)/make.tmpl
-LIBS += -ldevmapper-event-lvm2 $(INTERNAL_LIBS)
-
install_lvm2: install_dm_plugin
install: install_lvm2
diff --git a/daemons/dmeventd/plugins/raid/Makefile.in b/daemons/dmeventd/plugins/raid/Makefile.in
index c00e624..abc935d 100644
--- a/daemons/dmeventd/plugins/raid/Makefile.in
+++ b/daemons/dmeventd/plugins/raid/Makefile.in
@@ -16,6 +16,7 @@ top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
CLDFLAGS += -L$(top_builddir)/daemons/dmeventd/plugins/lvm2
+LIBS += -ldevmapper-event-lvm2
SOURCES = dmeventd_raid.c
@@ -28,8 +29,6 @@ CFLOW_LIST_TARGET = $(LIB_NAME).cflow
include $(top_builddir)/make.tmpl
-LIBS += -ldevmapper-event-lvm2 $(INTERNAL_LIBS)
-
install_lvm2: install_dm_plugin
install: install_lvm2
diff --git a/daemons/dmeventd/plugins/snapshot/Makefile.in b/daemons/dmeventd/plugins/snapshot/Makefile.in
index adbb3e2..c5f71b8 100644
--- a/daemons/dmeventd/plugins/snapshot/Makefile.in
+++ b/daemons/dmeventd/plugins/snapshot/Makefile.in
@@ -17,6 +17,7 @@ top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
CLDFLAGS += -L$(top_builddir)/daemons/dmeventd/plugins/lvm2
+LIBS += -ldevmapper-event-lvm2
SOURCES = dmeventd_snapshot.c
@@ -25,8 +26,6 @@ LIB_VERSION = $(LIB_VERSION_LVM)
include $(top_builddir)/make.tmpl
-LIBS += -ldevmapper-event-lvm2 $(INTERNAL_LIBS)
-
install_lvm2: install_dm_plugin
install: install_lvm2
diff --git a/daemons/dmeventd/plugins/thin/Makefile.in b/daemons/dmeventd/plugins/thin/Makefile.in
index 7968504..c1cbee7 100644
--- a/daemons/dmeventd/plugins/thin/Makefile.in
+++ b/daemons/dmeventd/plugins/thin/Makefile.in
@@ -16,6 +16,7 @@ top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
CLDFLAGS += -L$(top_builddir)/daemons/dmeventd/plugins/lvm2
+LIBS += -ldevmapper-event-lvm2
SOURCES = dmeventd_thin.c
@@ -28,8 +29,6 @@ CFLOW_LIST_TARGET = $(LIB_NAME).cflow
include $(top_builddir)/make.tmpl
-LIBS += -ldevmapper-event-lvm2 $(INTERNAL_LIBS)
-
install_lvm2: install_dm_plugin
install: install_lvm2
diff --git a/daemons/dmeventd/plugins/vdo/Makefile.in b/daemons/dmeventd/plugins/vdo/Makefile.in
index 8e90e27..84adb74 100644
--- a/daemons/dmeventd/plugins/vdo/Makefile.in
+++ b/daemons/dmeventd/plugins/vdo/Makefile.in
@@ -16,6 +16,7 @@ top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
CLDFLAGS += -L$(top_builddir)/daemons/dmeventd/plugins/lvm2
+LIBS += -ldevmapper-event-lvm2
SOURCES = dmeventd_vdo.c
@@ -28,8 +29,6 @@ CFLOW_LIST_TARGET = $(LIB_NAME).cflow
include $(top_builddir)/make.tmpl
-LIBS += -ldevmapper-event-lvm2 $(INTERNAL_LIBS)
-
install_lvm2: install_dm_plugin
install: install_lvm2
5 years, 4 months
master - dmeventd: fix linking with libdevmapper
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=035a7b9a4bf77798d9d...
Commit: 035a7b9a4bf77798d9d7ecdb7cfa8dfd77a92729
Parent: c666e8d25e724802a85489c548adc763949fdfa9
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Dec 14 16:28:26 2018 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Dec 14 22:33:22 2018 +0100
dmeventd: fix linking with libdevmapper
Since dmeventd is 'libdm' based project, it needs to link
libdm library instead of its internal version
An external users may provide plugins loadeable by dmeventd.
So external user of libdevmapper-event library has no other option
then to link with released libdevmapper library.
The complexity comes with lvm2 plugins.
The lvm2 plugin itself uses internal version of device_mapper,
but libdevmapper-event usage is libdm based - so there needs to be avoided
any breakage on compatibility of internal i.e. dm_task_run structures.
TODO: most likely dmeventd itself should be moved into libdm/dm-tools dir,
and only lvm2 plugins should be created as part of lvm project,
but those still need to link with libdevmapper.
---
daemons/dmeventd/Makefile.in | 3 +--
daemons/dmeventd/dmeventd.c | 13 ++++++-------
daemons/dmeventd/libdevmapper-event.c | 9 +++++----
daemons/dmeventd/libdevmapper-event.h | 1 +
4 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/daemons/dmeventd/Makefile.in b/daemons/dmeventd/Makefile.in
index 0a03d66..6bd36d0 100644
--- a/daemons/dmeventd/Makefile.in
+++ b/daemons/dmeventd/Makefile.in
@@ -57,8 +57,7 @@ all: device-mapper
device-mapper: $(TARGETS)
CFLAGS_dmeventd.o += $(EXTRA_EXEC_CFLAGS)
-LIBS += $(PTHREAD_LIBS)
-LIBS += $(INTERNAL_LIBS)
+LIBS += $(PTHREAD_LIBS) -L$(top_builddir)/libdm -ldevmapper
dmeventd: $(LIB_SHARED) dmeventd.o
@echo " [CC] $@"
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index dcc743d..4a58449 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -16,14 +16,13 @@
* dmeventd - dm event daemon to monitor active mapped devices
*/
-#include "device_mapper/misc/dmlib.h"
-#include "base/memory/zalloc.h"
-#include "device_mapper/misc/dm-logging.h"
-#include "daemons/dmeventd/libdevmapper-event.h"
+#include "configure.h"
+#include "libdevmapper-event.h"
#include "dmeventd.h"
-#include "tools/tool.h"
+#include "libdm/misc/dm-logging.h"
+#include "base/memory/zalloc.h"
#include <dlfcn.h>
#include <pthread.h>
@@ -35,6 +34,8 @@
#include <signal.h>
#include <arpa/inet.h> /* for htonl, ntohl */
#include <fcntl.h> /* for musl libc */
+#include <unistd.h>
+#include <syslog.h>
#ifdef __linux__
/*
@@ -62,8 +63,6 @@
#endif
-#include <syslog.h>
-
#define DM_SIGNALED_EXIT 1
#define DM_SCHEDULED_EXIT 2
static volatile sig_atomic_t _exit_now = 0; /* set to '1' when signal is given to exit */
diff --git a/daemons/dmeventd/libdevmapper-event.c b/daemons/dmeventd/libdevmapper-event.c
index 1c4607a..6465f64 100644
--- a/daemons/dmeventd/libdevmapper-event.c
+++ b/daemons/dmeventd/libdevmapper-event.c
@@ -12,11 +12,12 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "device_mapper/misc/dmlib.h"
-#include "base/memory/zalloc.h"
-#include "device_mapper/misc/dm-logging.h"
-#include "daemons/dmeventd/libdevmapper-event.h"
+#include "configure.h"
+#include "libdevmapper-event.h"
#include "dmeventd.h"
+#include "libdm/misc/dm-logging.h"
+#include "base/memory/zalloc.h"
+
#include "lib/misc/intl.h"
#include <fcntl.h>
diff --git a/daemons/dmeventd/libdevmapper-event.h b/daemons/dmeventd/libdevmapper-event.h
index 4c97223..cc65e72 100644
--- a/daemons/dmeventd/libdevmapper-event.h
+++ b/daemons/dmeventd/libdevmapper-event.h
@@ -21,6 +21,7 @@
#ifndef LIB_DMEVENT_H
#define LIB_DMEVENT_H
+#include <stdarg.h>
#include <stdint.h>
/*
5 years, 4 months
master - dmfilemapd: avoid linking with DL_LIBS
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c666e8d25e724802a85...
Commit: c666e8d25e724802a85489c548adc763949fdfa9
Parent: f514e379786689a47518bf67d71a388977cc7369
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Dec 14 16:27:27 2018 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Dec 14 22:27:33 2018 +0100
dmfilemapd: avoid linking with DL_LIBS
Dmfilemapd is not using dlopen so doesn't need to be linked with
DL_LIBS.
---
libdm/dm-tools/Makefile.in | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libdm/dm-tools/Makefile.in b/libdm/dm-tools/Makefile.in
index abb0e95..33110dc 100644
--- a/libdm/dm-tools/Makefile.in
+++ b/libdm/dm-tools/Makefile.in
@@ -82,12 +82,12 @@ ifeq ("@BUILD_DMFILEMAPD@", "yes")
dmfilemapd: $(LIB_SHARED) dmfilemapd.o
@echo " [CC] $<"
$(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_EXEC_LDFLAGS) $(ELDFLAGS) \
- -o $@ dmfilemapd.o -L$(top_builddir)/libdm -ldevmapper $(DL_LIBS) $(LIBS)
+ -o $@ dmfilemapd.o -L$(top_builddir)/libdm -ldevmapper $(LIBS)
dmfilemapd.static: $(LIB_STATIC) dmfilemapd.o
@echo " [CC] $<"
$(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(ELDFLAGS) -static -L$(interfacebuilddir) \
- -o $@ dmfilemapd.o $(DL_LIBS) $(LIBS) $(STATIC_LIBS)
+ -o $@ dmfilemapd.o $(LIBS) $(STATIC_LIBS)
install_dmfilemapd_dynamic: dmfilemapd
@echo " [INSTALL] $<"
5 years, 4 months
master - lvconvert: ensure proper init of pv_list
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f514e379786689a4751...
Commit: f514e379786689a47518bf67d71a388977cc7369
Parent: 2e01af0f78fb63c084998f728668553d8cce2b64
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Dec 14 21:53:34 2018 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Dec 14 22:27:33 2018 +0100
lvconvert: ensure proper init of pv_list
---
tools/lvconvert.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 8329bc6..c260ee0 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -484,7 +484,7 @@ static struct dm_list *_failed_pv_list(struct volume_group *vg)
if (pvl->pv->pe_alloc_count == 0)
continue;
- if (!(new_pvl = dm_pool_alloc(vg->vgmem, sizeof(*new_pvl)))) {
+ if (!(new_pvl = dm_pool_zalloc(vg->vgmem, sizeof(*new_pvl)))) {
log_error("Allocation of failed_pvs list entry failed.");
return NULL;
}
5 years, 4 months
master - lvmdbusd: Update table lookup for state lv_attr
by Tony Asleson
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=2e01af0f78fb63c0849...
Commit: 2e01af0f78fb63c084998f728668553d8cce2b64
Parent: a6cba2d0a08e77a7e5178a2fac605863848a8e2e
Author: Tony Asleson <tasleson(a)redhat.com>
AuthorDate: Tue Dec 11 11:24:51 2018 -0600
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Fri Dec 14 08:28:03 2018 -0600
lvmdbusd: Update table lookup for state lv_attr
---
daemons/lvmdbusd/lv.py | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/daemons/lvmdbusd/lv.py b/daemons/lvmdbusd/lv.py
index 1b66af5..c0029b8 100644
--- a/daemons/lvmdbusd/lv.py
+++ b/daemons/lvmdbusd/lv.py
@@ -346,13 +346,19 @@ class LvCommon(AutomatedProperties):
@property
def State(self):
- type_map = {'a': 'active', 's': 'suspended', 'I': 'Invalid snapshot',
+ type_map = {'a': 'active',
+ 's': 'suspended',
+ 'I': 'Invalid snapshot',
'S': 'invalid Suspended snapshot',
'm': 'snapshot merge failed',
'M': 'suspended snapshot (M)erge failed',
'd': 'mapped device present without tables',
'i': 'mapped device present with inactive table',
- 'X': 'unknown', '-': 'Unspecified'}
+ 'h': 'historical',
+ 'c': 'check needed suspended thin-pool',
+ 'C': 'check needed',
+ 'X': 'unknown',
+ '-': 'Unspecified'}
return self.attr_struct(4, type_map)
@property
5 years, 4 months
master - lvmdbusd: Update table lookup for health lv_attr
by Tony Asleson
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a6cba2d0a08e77a7e51...
Commit: a6cba2d0a08e77a7e5178a2fac605863848a8e2e
Parent: 51f08efaa700550740254093bacea270325f2ccf
Author: Tony Asleson <tasleson(a)redhat.com>
AuthorDate: Tue Dec 11 11:23:56 2018 -0600
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Fri Dec 14 08:28:02 2018 -0600
lvmdbusd: Update table lookup for health lv_attr
---
daemons/lvmdbusd/lv.py | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/daemons/lvmdbusd/lv.py b/daemons/lvmdbusd/lv.py
index a80675f..1b66af5 100644
--- a/daemons/lvmdbusd/lv.py
+++ b/daemons/lvmdbusd/lv.py
@@ -369,9 +369,17 @@ class LvCommon(AutomatedProperties):
@property
def Health(self):
- type_map = {'p': 'partial', 'r': 'refresh',
- 'm': 'mismatches', 'w': 'writemostly',
- 'X': 'X unknown', '-': 'Unspecified'}
+ type_map = {'p': 'partial',
+ 'r': 'refresh needed',
+ 'm': 'mismatches',
+ 'w': 'writemostly',
+ 'X': 'unknown',
+ '-': 'unspecified',
+ 's': 'reshaping',
+ 'F': 'failed',
+ 'D': 'Data space',
+ 'R': 'Remove',
+ 'M': 'Metadata'}
return self.attr_struct(8, type_map)
@property
5 years, 4 months
master - lvmdbusd: Dump blackbox newest first
by Tony Asleson
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f1684bf8e89b87d7f04...
Commit: f1684bf8e89b87d7f04e0a963def66f76634766d
Parent: 859feb81e5b61ac2109b1d7850844ccf1ce3e5bf
Author: Tony Asleson <tasleson(a)redhat.com>
AuthorDate: Tue Dec 11 13:58:23 2018 -0600
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Fri Dec 14 08:28:02 2018 -0600
lvmdbusd: Dump blackbox newest first
When we get bug reports we may not get the entire log, so lets
dump the fight recorder from newest to oldest as the one we
are interested in was likely to be the last command run.
---
daemons/lvmdbusd/cmdhandler.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/daemons/lvmdbusd/cmdhandler.py b/daemons/lvmdbusd/cmdhandler.py
index 4fb1670..a9177c5 100644
--- a/daemons/lvmdbusd/cmdhandler.py
+++ b/daemons/lvmdbusd/cmdhandler.py
@@ -67,7 +67,7 @@ class LvmFlightRecorder(object):
with cmd_lock:
if len(self.queue):
log_error("LVM dbus flight recorder START")
- for c in self.queue:
+ for c in reversed(self.queue):
log_error(str(c))
log_error("LVM dbus flight recorder END")
5 years, 4 months