summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2016-02-25 15:04:17 -0600
committerDavid Teigland <teigland@redhat.com>2016-02-25 15:04:17 -0600
commit6218dbf4d83c8f231f0d8758e79ce84a3bda89df (patch)
treed2b0b8312e0541905f09d26d7010715cb0f4b8c3
parent3b02fc994b40b19e41471ffde0d02741d43b73a9 (diff)
downloadlvm2-dev-dct-notify11.tar.gz
add config setting for dbus notificationdev-dct-notify11
-rw-r--r--lib/config/config_settings.h5
-rw-r--r--lib/config/defaults.h1
-rw-r--r--tools/lvmcmdline.c2
3 files changed, 7 insertions, 1 deletions
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index 1143c8b6e..6164bc717 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -995,6 +995,11 @@ cfg(global_use_lvmpolld_CFG, "use_lvmpolld", global_CFG_SECTION, 0, CFG_TYPE_BOO
"and to use its own control group. When this option is disabled, LVM\n"
"commands will supervise long running operations by forking themselves.\n")
+cfg(global_notify_dbus_CFG, "notify_dbus", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_NOTIFY_DBUS, vsn(2, 2, 145), NULL, 0, NULL,
+ "Enable DBUS notification from LVM commands.\n"
+ "When enabled, an LVM command that changes PVs, changes VG metadata,\n"
+ "or changes LV activation will send a DBUS notification.\n")
+
cfg(activation_udev_sync_CFG, "udev_sync", activation_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_UDEV_SYNC, vsn(2, 2, 51), NULL, 0, NULL,
"Use udev notifications to synchronize udev and LVM.\n"
"The --nodevsync option overrides this setting.\n"
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
index 080c3ffe0..761406df1 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h
@@ -135,6 +135,7 @@
#define DEFAULT_READ_AHEAD "auto"
#define DEFAULT_UDEV_RULES 1
#define DEFAULT_UDEV_SYNC 1
+#define DEFAULT_NOTIFY_DBUS 1
#define DEFAULT_VERIFY_UDEV_OPERATIONS 0
#define DEFAULT_RETRY_DEACTIVATION 1
#define DEFAULT_ACTIVATION_CHECKS 0
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 6450b7785..7fa41c372 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -1657,7 +1657,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
lvmlockd_disconnect();
fin_locking();
- if (!_cmd_no_meta_proc(cmd))
+ if (!_cmd_no_meta_proc(cmd) && find_config_tree_bool(cmd, global_notify_dbus_CFG, NULL))
lvmnotify_send(cmd);
out: