summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2015-10-21 13:49:43 -0500
committerDavid Teigland <teigland@redhat.com>2015-10-21 14:02:43 -0500
commit38809d1484c58e4a73c978f77cb1a6237d09e32e (patch)
treee4dc264066d960bd2d3ca56719cfe5191411abc4
parent1946b610178bce34640910103172b25e2241ac41 (diff)
downloadlvm2-38809d1484c58e4a73c978f77cb1a6237d09e32e.tar.gz
lvmnotify: add --nodbusnotify option
to all commands. lvm dbus daemon will set this option to distinguish lvm commands run by the daemon and lvm commands run by users. Commands run by the dbus daemon do not need to notify the dbus daemon because the dbus daemon obviously knows they've been run, but commands run by a user need to notify the dbus daemon because the dbus daemon would not otherwise know they've been run.
-rw-r--r--tools/args.h1
-rw-r--r--tools/lvmcmdline.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/tools/args.h b/tools/args.h
index c88777438..9f785215a 100644
--- a/tools/args.h
+++ b/tools/args.h
@@ -68,6 +68,7 @@ arg(mirrorsonly_ARG, '\0', "mirrorsonly", NULL, 0)
arg(mknodes_ARG, '\0', "mknodes", NULL, 0)
arg(monitor_ARG, '\0', "monitor", yes_no_arg, 0)
arg(nameprefixes_ARG, '\0', "nameprefixes", NULL, 0)
+arg(nodbusnotify_ARG, '\0', "nodbusnotify", NULL, 0)
arg(noheadings_ARG, '\0', "noheadings", NULL, 0)
arg(nolocking_ARG, '\0', "nolocking", NULL, 0)
arg(norestorefile_ARG, '\0', "norestorefile", NULL, 0)
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 85523bac6..f8e93755c 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -773,6 +773,7 @@ void lvm_register_commands(void)
yes_ARG, \
quiet_ARG, config_ARG, \
commandprofile_ARG, \
+ nodbusnotify_ARG, \
profile_ARG, -1);
#include "commands.h"
#undef xx
@@ -1640,7 +1641,8 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
goto_out;
}
- if (!_cmd_no_meta_proc(cmd) && !lvmnotify_init(cmd))
+ if (!_cmd_no_meta_proc(cmd) && !arg_is_set(cmd, nodbusnotify_ARG) &&
+ !lvmnotify_init(cmd))
log_verbose("Unable to initialize notifications.");
/*