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

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