Blame SOURCES/0195-RHBZ-1359510-no-daemon-msg.patch

d88bf6
---
d88bf6
 libmultipath/configure.c |   21 ++++++++++++++++++++-
d88bf6
 libmultipath/configure.h |    1 +
d88bf6
 multipath/main.c         |   21 +++++++++++++++++++++
d88bf6
 3 files changed, 42 insertions(+), 1 deletion(-)
d88bf6
d88bf6
Index: multipath-tools-130222/libmultipath/configure.c
d88bf6
===================================================================
d88bf6
--- multipath-tools-130222.orig/libmultipath/configure.c
d88bf6
+++ multipath-tools-130222/libmultipath/configure.c
d88bf6
@@ -743,7 +743,8 @@ deadmap (struct multipath * mpp)
d88bf6
 	return 1; /* dead */
d88bf6
 }
d88bf6
 
d88bf6
-int check_daemon(void)
d88bf6
+extern int
d88bf6
+check_daemon(void)
d88bf6
 {
d88bf6
 	int fd;
d88bf6
 	char *reply;
d88bf6
@@ -776,6 +777,7 @@ coalesce_paths (struct vectors * vecs, v
d88bf6
 {
d88bf6
 	int r = 1;
d88bf6
 	int k, i;
d88bf6
+	int map_processed = 0;
d88bf6
 	char empty_buff[WWID_SIZE];
d88bf6
 	char params[PARAMS_SIZE];
d88bf6
 	struct multipath * mpp;
d88bf6
@@ -936,6 +938,13 @@ coalesce_paths (struct vectors * vecs, v
d88bf6
 			else
d88bf6
 				remove_map(mpp, vecs, 0);
d88bf6
 		}
d88bf6
+
d88bf6
+		/* By now at least one multipath device map is processed,
d88bf6
+		 * so set map_processed = 1
d88bf6
+		 */
d88bf6
+		if (!map_processed)
d88bf6
+			map_processed = 1;
d88bf6
+
d88bf6
 	}
d88bf6
 	/*
d88bf6
 	 * Flush maps with only dead paths (ie not in sysfs)
d88bf6
@@ -963,6 +972,16 @@ coalesce_paths (struct vectors * vecs, v
d88bf6
 				condlog(2, "%s: remove (dead)", alias);
d88bf6
 		}
d88bf6
 	}
d88bf6
+
d88bf6
+	/* If there is at least one multipath device map processed then
d88bf6
+	 * check if 'multipathd' service is running or not?
d88bf6
+	 */
d88bf6
+	if (map_processed)  {
d88bf6
+		if (!conf->daemon && !check_daemon())
d88bf6
+			condlog(0, "'multipathd' service is currently not "
d88bf6
+				"running, IO failover/failback will not work");
d88bf6
+	}
d88bf6
+
d88bf6
 	return 0;
d88bf6
 }
d88bf6
 
d88bf6
Index: multipath-tools-130222/libmultipath/configure.h
d88bf6
===================================================================
d88bf6
--- multipath-tools-130222.orig/libmultipath/configure.h
d88bf6
+++ multipath-tools-130222/libmultipath/configure.h
d88bf6
@@ -27,6 +27,7 @@ enum actions {
d88bf6
 int setup_map (struct multipath * mpp, char * params, int params_size );
d88bf6
 int domap (struct multipath * mpp, char * params);
d88bf6
 int reinstate_paths (struct multipath *mpp);
d88bf6
+int check_daemon(void);
d88bf6
 int coalesce_paths (struct vectors *vecs, vector curmp, char * refwwid, int force_reload);
d88bf6
 int get_refwwid (char * dev, enum devtypes dev_type, vector pathvec, char **wwid);
d88bf6
 int reload_map(struct vectors *vecs, struct multipath *mpp, int refresh);
d88bf6
Index: multipath-tools-130222/multipath/main.c
d88bf6
===================================================================
d88bf6
--- multipath-tools-130222.orig/multipath/main.c
d88bf6
+++ multipath-tools-130222/multipath/main.c
d88bf6
@@ -178,6 +178,7 @@ static int
d88bf6
 get_dm_mpvec (vector curmp, vector pathvec, char * refwwid)
d88bf6
 {
d88bf6
 	int i;
d88bf6
+	int maps_present = 0;
d88bf6
 	struct multipath * mpp;
d88bf6
 	char params[PARAMS_SIZE], status[PARAMS_SIZE];
d88bf6
 
d88bf6
@@ -226,7 +227,27 @@ get_dm_mpvec (vector curmp, vector pathv
d88bf6
 
d88bf6
 		if (conf->cmd == CMD_CREATE)
d88bf6
 			reinstate_paths(mpp);
d88bf6
+
d88bf6
+		/* At this place we have found at least one multipath
d88bf6
+		 * device map, so set maps_present = 1
d88bf6
+		 */
d88bf6
+		if (!maps_present)
d88bf6
+			maps_present = 1;
d88bf6
+
d88bf6
 	}
d88bf6
+
d88bf6
+	/* If there is at least one multipath device map present then
d88bf6
+	 * check if 'multipathd' service is running or not?
d88bf6
+	 */
d88bf6
+	if (maps_present) {
d88bf6
+		if (!conf->daemon && !check_daemon()) {
d88bf6
+			condlog(0, "multipath device maps are present, but "
d88bf6
+				"'multipathd' service is not running");
d88bf6
+			condlog(0, "IO failover/failback will not work without "
d88bf6
+				"'multipathd' service running");
d88bf6
+		}
d88bf6
+	}
d88bf6
+
d88bf6
 	return 0;
d88bf6
 }
d88bf6