Blame SOURCES/0030-multipath-add-option-to-skip-multipathd-delegation.patch

96a22b
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
96a22b
From: Benjamin Marzinski <bmarzins@redhat.com>
96a22b
Date: Tue, 16 Jun 2020 17:36:33 -0500
96a22b
Subject: [PATCH] multipath: add option to skip multipathd delegation
96a22b
96a22b
Add the -D option to allow users to skip delegating commands to
96a22b
multipathd.
96a22b
96a22b
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
96a22b
---
96a22b
 libmultipath/config.h | 1 +
96a22b
 multipath/main.c      | 8 +++++++-
96a22b
 2 files changed, 8 insertions(+), 1 deletion(-)
96a22b
96a22b
diff --git a/libmultipath/config.h b/libmultipath/config.h
96a22b
index 4042eba6..160867cd 100644
96a22b
--- a/libmultipath/config.h
96a22b
+++ b/libmultipath/config.h
96a22b
@@ -191,6 +191,7 @@ struct config {
96a22b
 	int ghost_delay;
96a22b
 	int find_multipaths_timeout;
96a22b
 	int marginal_pathgroups;
96a22b
+	int skip_delegate;
96a22b
 	unsigned int version[3];
96a22b
 	unsigned int sequence_nr;
96a22b
 
96a22b
diff --git a/multipath/main.c b/multipath/main.c
96a22b
index 612c6815..3c3d2398 100644
96a22b
--- a/multipath/main.c
96a22b
+++ b/multipath/main.c
96a22b
@@ -825,6 +825,9 @@ int delegate_to_multipathd(enum mpath_cmds cmd,
96a22b
 	*p = '\0';
96a22b
 	n = sizeof(command);
96a22b
 
96a22b
+	if (conf->skip_delegate)
96a22b
+		return NOT_DELEGATED;
96a22b
+
96a22b
 	if (cmd == CMD_CREATE && conf->force_reload == FORCE_RELOAD_YES) {
96a22b
 		p += snprintf(p, n, "reconfigure");
96a22b
 	}
96a22b
@@ -923,7 +926,7 @@ main (int argc, char *argv[])
96a22b
 	multipath_conf = conf;
96a22b
 	conf->retrigger_tries = 0;
96a22b
 	conf->force_sync = 1;
96a22b
-	while ((arg = getopt(argc, argv, ":aAdcChl::FfM:v:p:b:BrR:itTquUwW")) != EOF ) {
96a22b
+	while ((arg = getopt(argc, argv, ":aAdDcChl::FfM:v:p:b:BrR:itTquUwW")) != EOF ) {
96a22b
 		switch(arg) {
96a22b
 		case 1: printf("optarg : %s\n",optarg);
96a22b
 			break;
96a22b
@@ -955,6 +958,9 @@ main (int argc, char *argv[])
96a22b
 			if (cmd == CMD_CREATE)
96a22b
 				cmd = CMD_DRY_RUN;
96a22b
 			break;
96a22b
+		case 'D':
96a22b
+			conf->skip_delegate = 1;
96a22b
+			break;
96a22b
 		case 'f':
96a22b
 			cmd = CMD_FLUSH_ONE;
96a22b
 			break;
96a22b
-- 
96a22b
2.17.2
96a22b