[lvm-devel] master - lvmdbusd: Only disable notify_dbus after getting external event

Tony Asleson tasleson at sourceware.org
Mon Mar 20 15:10:51 UTC 2017


Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=2dc71fc291b3ac861298b4dd7b25963dd9325a4d
Commit:        2dc71fc291b3ac861298b4dd7b25963dd9325a4d
Parent:        17b56a4aed90806eac03c32f013f552440b2f596
Author:        Tony Asleson <tasleson at redhat.com>
AuthorDate:    Wed Mar 15 10:57:01 2017 -0500
Committer:     Tony Asleson <tasleson at redhat.com>
CommitterDate: Mon Mar 20 10:08:38 2017 -0500

lvmdbusd: Only disable notify_dbus after getting external event

If we always disable the sending of notify dbus events then in the case
where all the users are lvm dbus users we will be in udev handling mode
until at least 1 external lvm command occurs.  Instead we will not disable
notify dbus until after we get at least 1 external event.  This makes the
service get into the correct mode of operation faster.
---
 daemons/lvmdbusd/utils.py |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/daemons/lvmdbusd/utils.py b/daemons/lvmdbusd/utils.py
index 2e7b808..c9a84cc 100644
--- a/daemons/lvmdbusd/utils.py
+++ b/daemons/lvmdbusd/utils.py
@@ -510,16 +510,19 @@ def add_no_notify(cmdline):
 	:rtype: list
 	"""
 
-	if 'help' in cmdline:
-		return cmdline
-
-	if '--config' in cmdline:
-		for i, arg in enumerate(cmdline):
-			if arg == '--config':
-				cmdline[i] += "global/notify_dbus=0"
-				break
-	else:
-		cmdline.extend(['--config', 'global/notify_dbus=0'])
+	# Only after we have seen an external event will be disable lvm from sending
+	# us one when we call lvm
+	if cfg.ee:
+		if 'help' in cmdline:
+			return cmdline
+
+		if '--config' in cmdline:
+			for i, arg in enumerate(cmdline):
+				if arg == '--config':
+					cmdline[i] += "global/notify_dbus=0"
+					break
+		else:
+			cmdline.extend(['--config', 'global/notify_dbus=0'])
 	return cmdline
 
 




More information about the lvm-devel mailing list