summaryrefslogtreecommitdiff
path: root/lib/notify
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2016-03-07 10:50:45 -0600
committerDavid Teigland <teigland@redhat.com>2016-03-07 10:50:45 -0600
commita8319e62c079e807af275f220dbd6ea875b0c0c6 (patch)
tree666c45981d9a42c128ff74c98d777d2c1b236a66 /lib/notify
parent2d5dc6512e10924ab68e6a139081d7121bc3f7d6 (diff)
downloadlvm2-a8319e62c079e807af275f220dbd6ea875b0c0c6.tar.gz
vgscan: add --notifydbus to send a notification
This command option can be used to trigger a D-Bus notification independent of the usual notifications that are sent from other commands as an effect of changes to PV/VG/LV state. If lvm is not built with dbus notification support or if notify_dbus is disabled in the config, this command will exit with an error.
Diffstat (limited to 'lib/notify')
-rw-r--r--lib/notify/lvmnotify.c10
-rw-r--r--lib/notify/lvmnotify.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/notify/lvmnotify.c b/lib/notify/lvmnotify.c
index 0b04ee4ba..3bcf5aefc 100644
--- a/lib/notify/lvmnotify.c
+++ b/lib/notify/lvmnotify.c
@@ -20,6 +20,11 @@
#ifdef NOTIFYDBUS_SUPPORT
#include <systemd/sd-bus.h>
+int lvmnotify_is_supported(void)
+{
+ return 1;
+}
+
void lvmnotify_send(struct cmd_context *cmd)
{
sd_bus *bus = NULL;
@@ -89,6 +94,11 @@ void set_pv_notify(struct cmd_context *cmd)
#else
+int lvmnotify_is_supported(void)
+{
+ return 0;
+}
+
void lvmnotify_send(struct cmd_context *cmd)
{
}
diff --git a/lib/notify/lvmnotify.h b/lib/notify/lvmnotify.h
index 43fffd0da..fe56b106a 100644
--- a/lib/notify/lvmnotify.h
+++ b/lib/notify/lvmnotify.h
@@ -11,6 +11,7 @@
#ifndef _LVMNOTIFY_H
#define _LVMNOTIFY_H
+int lvmnotify_is_supported(void);
void lvmnotify_send(struct cmd_context *cmd);
void set_vg_notify(struct cmd_context *cmd);
void set_lv_notify(struct cmd_context *cmd);