From 54d9d3cf3cacb704f2c77f02f51f1024c45fd086 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Fri, 27 Jan 2006 19:05:05 +0000 Subject: [PATCH] Add config file setting: dmeventd/mirror_library --- doc/example.conf | 5 +++++ lib/config/defaults.h | 2 ++ lib/mirror/mirrored.c | 9 +++------ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/doc/example.conf b/doc/example.conf index c44c6a7a0..425cc3ea0 100644 --- a/doc/example.conf +++ b/doc/example.conf @@ -289,4 +289,9 @@ activation { # dirs = [ "/etc/lvm/metadata", "/mnt/disk2/lvm/metadata2" ] #} +# Event daemon +# +#dmeventd { + # mirror_library = "libdevmapper-event-lvm2mirror.so" +#} diff --git a/lib/config/defaults.h b/lib/config/defaults.h index aa6c47011..e47e08b87 100644 --- a/lib/config/defaults.h +++ b/lib/config/defaults.h @@ -34,6 +34,8 @@ #define DEFAULT_LOCK_DIR "/var/lock/lvm" #define DEFAULT_LOCKING_LIB "lvm2_locking.so" +#define DEFAULT_DMEVENTD_MIRROR_LIB "libdevmapper-event-lvm2mirror.so" + #define DEFAULT_UMASK 0077 #ifdef LVM1_FALLBACK diff --git a/lib/mirror/mirrored.c b/lib/mirror/mirrored.c index 1e7ee09de..4670cff42 100644 --- a/lib/mirror/mirrored.c +++ b/lib/mirror/mirrored.c @@ -357,11 +357,8 @@ static int _setup_registration(struct dm_pool *mem, struct config_tree *cft, char **dso) { /* FIXME Follow lvm2 searching rules (see sharedlib.c) */ - /* FIXME Use naming convention in config file */ - if (!(*dso = find_config_str(cft->root, "global/mirror_dso", NULL))) { - log_error("No mirror dso specified in config file"); /* FIXME readability */ - return 0; - } + *dso = find_config_str(cft->root, "dmeventd/mirror_library", + DEFAULT_DMEVENTD_MIRROR_LIB); return 1; } @@ -390,7 +387,7 @@ static int _target_register_events(struct dm_pool *mem, strncpy(dm_name, build_dm_name(mem, vg->name, lv->name, NULL), PATH_MAX); - if((err = dm_event_register(dso, dm_name, DM_EVENT_ALL_ERRORS)) < 0) { + if ((err = dm_event_register(dso, dm_name, DM_EVENT_ALL_ERRORS)) < 0) { log_error("Unable to register %s for events: %s", dm_name, strerror(-err)); return 0;