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

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