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