Skip to contentSkip to conversation

master - poll daemon: only call lvmetad_connect when needed

PATCH David Teigland 1 participant 1 message Apr 21, 2016

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4d095c2fbb4383fc4830b9b714f8a7fd45b40fcd
Commit:        4d095c2fbb4383fc4830b9b714f8a7fd45b40fcd
Parent:        11dd36245450ed664c4a6bd177f17a8077c820a1
Author:        David Teigland <[email protected]>
AuthorDate:    Thu Apr 21 15:58:34 2016 -0500
Committer:     David Teigland <[email protected]>
CommitterDate: Thu Apr 21 15:58:34 2016 -0500

poll daemon: only call lvmetad_connect when needed

When lvm is not using lvmetad, the lvmetad_connect() in the forked polling process is not needed and was generating unwanted warnings.

---
 tools/polldaemon.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tools/polldaemon.c +1 -1
index c2211d7..6b15a0d 100644
@@ -597,7 +597,7 @@ static int _poll_daemon(struct cmd_context *cmd, struct poll_operation_id *id,
 		/* FIXME Use wait_event (i.e. interval = 0) and */
 		/*       fork one daemon per copy? */
 
-		if (daemon_mode == 1) {
+		if ((daemon_mode == 1) && find_config_tree_bool(cmd, global_use_lvmetad_CFG, NULL)) {
 			if (!lvmetad_connect(cmd))
 				log_warn("WARNING: lvm polling process %d cannot connect to lvmetad.", getpid());
 		}