From 2e67a34b2fc44609ccf63a0ab4ccf0043d97f33e Mon Sep 17 00:00:00 2001 From: David Teigland Date: Thu, 25 Feb 2016 15:04:17 -0600 Subject: add config setting for dbus notification --- lib/config/config_settings.h | 5 +++++ lib/config/defaults.h | 1 + tools/lvmcmdline.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) 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: -- cgit v1.2.1