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

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