summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2016-02-25 15:04:17 -0600
committerDavid Teigland <teigland@redhat.com>2016-03-04 16:40:06 -0600
commit2e67a34b2fc44609ccf63a0ab4ccf0043d97f33e (patch)
treeb45158c17c17f7813192a013e0ae9f7d80373c2b
parentce7b7aeea224b5d976b0e5c2aa000144640c15cb (diff)
downloadlvm2-dev-dct-notify12.tar.gz
add config setting for dbus notificationdev-dct-notify12
-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 12911091c..c589ce2ae 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 D-Bus notification from LVM commands.\n"
+ "When enabled, an LVM command that changes PVs, changes VG metadata,\n"
+ "or changes the activation state of an LV will send a 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 fd7986c35..51fd01d5b 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h
@@ -138,6 +138,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 40f204b62..2ee54e8ff 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -1660,7 +1660,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: