1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

Add config file setting: dmeventd/mirror_library

This commit is contained in:
Alasdair Kergon 2006-01-27 19:05:05 +00:00
parent ed09d7e394
commit 54d9d3cf3c
3 changed files with 10 additions and 6 deletions

View File

@ -289,4 +289,9 @@ activation {
# dirs = [ "/etc/lvm/metadata", "/mnt/disk2/lvm/metadata2" ] # dirs = [ "/etc/lvm/metadata", "/mnt/disk2/lvm/metadata2" ]
#} #}
# Event daemon
#
#dmeventd {
# mirror_library = "libdevmapper-event-lvm2mirror.so"
#}

View File

@ -34,6 +34,8 @@
#define DEFAULT_LOCK_DIR "/var/lock/lvm" #define DEFAULT_LOCK_DIR "/var/lock/lvm"
#define DEFAULT_LOCKING_LIB "lvm2_locking.so" #define DEFAULT_LOCKING_LIB "lvm2_locking.so"
#define DEFAULT_DMEVENTD_MIRROR_LIB "libdevmapper-event-lvm2mirror.so"
#define DEFAULT_UMASK 0077 #define DEFAULT_UMASK 0077
#ifdef LVM1_FALLBACK #ifdef LVM1_FALLBACK

View File

@ -357,11 +357,8 @@ static int _setup_registration(struct dm_pool *mem, struct config_tree *cft,
char **dso) char **dso)
{ {
/* FIXME Follow lvm2 searching rules (see sharedlib.c) */ /* FIXME Follow lvm2 searching rules (see sharedlib.c) */
/* FIXME Use naming convention in config file */ *dso = find_config_str(cft->root, "dmeventd/mirror_library",
if (!(*dso = find_config_str(cft->root, "global/mirror_dso", NULL))) { DEFAULT_DMEVENTD_MIRROR_LIB);
log_error("No mirror dso specified in config file"); /* FIXME readability */
return 0;
}
return 1; 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), strncpy(dm_name, build_dm_name(mem, vg->name, lv->name, NULL),
PATH_MAX); 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, log_error("Unable to register %s for events: %s", dm_name,
strerror(-err)); strerror(-err));
return 0; return 0;