]> sourceware.org Git - lvm2.git/commitdiff
Keep the LVM-based dmeventd plugins from trying to manipulate the dmeventd
authorPetr Rockai <prockai@redhat.com>
Wed, 19 Oct 2011 08:46:26 +0000 (08:46 +0000)
committerPetr Rockai <prockai@redhat.com>
Wed, 19 Oct 2011 08:46:26 +0000 (08:46 +0000)
monitoring state of the logical volumes they are currently acting on.

Until now, every time a logical volume has been changed by a dmeventd plugin,
this plugin would have called back to dmeventd through the external FIFO
mechanism. I am fairly sure this was superfluous, inefficient and possibly even
dangerous.

daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c
tools/lvm2cmd.h
tools/lvmcmdlib.c

index 937d81d9feab1c047dabb1bfa6362d4b33ddee90..789c68a3f92247ef0245a80933da4831d50afebb 100644 (file)
@@ -113,6 +113,7 @@ int dmeventd_lvm2_init(void)
                        _mem_pool = NULL;
                        goto out;
                }
+               lvm2_disable_dmeventd_monitoring(_lvm_handle);
                /* FIXME Temporary: move to dmeventd core */
                lvm2_run(_lvm_handle, "_memlock_inc");
        }
index 66651d89bf13b17eebe42147315de065255a00f7..bf93787a49fabf50b7c9922fdf0de33796e80969 100644 (file)
@@ -51,6 +51,12 @@ void lvm2_log_fn(lvm2_log_fn_t log_fn);
  */ 
 void *lvm2_init(void);
 
+/*
+ * Disable any dmeventd calls that the library may otherwise do. Useful to avoid
+ * recursive calls from dmeventd to itself.
+ */
+void lvm2_disable_dmeventd_monitoring(void *handle);
+
 /*
  * Set log level (as above) if using built-in logging function. 
  * Default is LVM2_LOG_PRINT.  Use LVM2_LOG_SUPPRESS to suppress output.
index 6b2bc9d10b30694e0bb480ec101837ccb362d2e9..47bf1c888062d0ccad6e1984f30b0b1d63656303 100644 (file)
@@ -97,6 +97,10 @@ int lvm2_run(void *handle, const char *cmdline)
        return ret;
 }
 
+void lvm2_disable_dmeventd_monitoring(void *handle) {
+       init_dmeventd_monitor(DMEVENTD_MONITOR_IGNORE);
+}
+
 void lvm2_log_level(void *handle, int level)
 {
        struct cmd_context *cmd = (struct cmd_context *) handle;
This page took 0.032518 seconds and 5 git commands to generate.