diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c index 394aa4be7..2843bf800 100644 --- a/lib/commands/toolcontext.c +++ b/lib/commands/toolcontext.c @@ -1755,6 +1755,15 @@ bad: return 0; } +int init_run_by_dmeventd(struct cmd_context *cmd) +{ + init_dmeventd_monitor(DMEVENTD_MONITOR_IGNORE); + init_ignore_suspended_devices(1); + init_disable_dmeventd_monitoring(1); /* Lock settings */ + + return 0; +} + void destroy_config_context(struct cmd_context *cmd) { _destroy_config(cmd); diff --git a/lib/commands/toolcontext.h b/lib/commands/toolcontext.h index c6d938d8b..bb962dca6 100644 --- a/lib/commands/toolcontext.h +++ b/lib/commands/toolcontext.h @@ -233,6 +233,7 @@ int config_files_changed(struct cmd_context *cmd); int init_lvmcache_orphans(struct cmd_context *cmd); int init_filters(struct cmd_context *cmd, unsigned load_persistent_cache); int init_connections(struct cmd_context *cmd); +int init_run_by_dmeventd(struct cmd_context *cmd); /* * A config context is a very light weight cmd struct that diff --git a/tools/lvmcmdlib.c b/tools/lvmcmdlib.c index 024376826..64c0d8b6f 100644 --- a/tools/lvmcmdlib.c +++ b/tools/lvmcmdlib.c @@ -98,10 +98,9 @@ int lvm2_run(void *handle, const char *cmdline) return ret; } -void lvm2_disable_dmeventd_monitoring(void *handle) { - init_dmeventd_monitor(DMEVENTD_MONITOR_IGNORE); - init_ignore_suspended_devices(1); - init_disable_dmeventd_monitoring(1); /* Lock settings */ +void lvm2_disable_dmeventd_monitoring(void *handle) +{ + init_run_by_dmeventd((struct cmd_context *) handle); } void lvm2_log_level(void *handle, int level)