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

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