Skip to contentSkip to conversation

multipath-tools: disable foreign libraries by default

PATCH In review [email protected] 2 participants 5 messages May 8, 2020 – Jun 9, 2020 Device mapper

lore
Share & tools
lore
#0 lore raw

cover multipath-tools: disable foreign libraries by default

From: Martin Wilck <[email protected]>

Hi Christophe,

This is a follow-up to the previous discussion with topic 'RFC:
multipath-tools: NVMe native multipath and default setting for "enable_foreign"'. Upon Netapp's initiative, I'd asked for foreign libraries to be disabled by default. Ben had replied he'd agree, and suggested implementing a "-e" option for multipath to enable all foreign libraries:

https://www.redhat.com/archives/dm-devel/2020-February/msg00271.html

This patch set implements this idea.

Regards,
Martin

Martin Wilck (2):
libmultipath: set "enable_foreign" to NONE by default
multipath: add "-e" option to enable foreign libraries

 libmultipath/defaults.h    |  4 ++--
 multipath/main.c           | 11 ++++++++++-
 multipath/multipath.8      |  6 ++++++
 multipath/multipath.conf.5 |  5 +++--
 4 files changed, 21 insertions(+), 5 deletions(-)
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/2 libmultipath: set "enable_foreign" to NONE by default

From: Martin Wilck <[email protected]>

This has been requested by NetApp.

---
 libmultipath/defaults.h    | 4 ++--
 multipath/multipath.conf.5 | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)
libmultipath/defaults.h +2 -2
index e5ee6afe..01a501bd 100644
@@ -50,8 +50,8 @@
 #define DEFAULT_FIND_MULTIPATHS_TIMEOUT -10
 #define DEFAULT_UNKNOWN_FIND_MULTIPATHS_TIMEOUT 1
 #define DEFAULT_ALL_TG_PT ALL_TG_PT_OFF
-/* Enable all foreign libraries by default */
-#define DEFAULT_ENABLE_FOREIGN ""
+/* Enable no foreign libraries by default */
+#define DEFAULT_ENABLE_FOREIGN "NONE"
 
 #define CHECKINT_UNDEF		UINT_MAX
 #define DEFAULT_CHECKINT	5
multipath/multipath.conf.5 +3 -2
index 05a5e8ff..28cea88c 100644
@@ -1228,10 +1228,11 @@ Enables or disables foreign libraries (see section
 .I FOREIGN MULTIPATH SUPPORT
 below). The value is a regular expression; foreign libraries are loaded
 if their name (e.g. \(dqnvme\(dq) matches the expression. By default,
-all foreign libraries are enabled.
+no foreign libraries are enabled. Set this to \(dqnvme\(dq to enable NVMe native
+multipath support, or \(dq.*\(dq to enable all foreign libraries.
 .RS
 .TP
-The default is: \fB\(dq\(dq\fR (the empty regular expression)
+The default is: \fB\(dqNONE\(dq\fR
 .RE
 .
 .
Signature · 1 line
2.26.2
#2 lore raw

PATCH 2/2 multipath: add "-e" option to enable foreign libraries

In reply to [email protected]

From: Martin Wilck <[email protected]>

As we have set "enable_foreign" to "NONE" now by default, users may find it useful to be able to switch on foreign multipath display with an extra command line option even if foreign libraries are not enabled in multipath.conf. Currently this makes only sense with "multipath -ll", as the nvme library (and foreign libraries in general) support only the display of status information.

---
 multipath/main.c      | 11 ++++++++++-
 multipath/multipath.8 |  6 ++++++
 2 files changed, 16 insertions(+), 1 deletion(-)
multipath/main.c +10 -1
index cf9d2a28..af9d757a 100644
@@ -148,6 +148,7 @@ usage (char * progname)
 		"  -h      print this usage text\n"
 		"  -l      show multipath topology (sysfs and DM info)\n"
 		"  -ll     show multipath topology (maximum info)\n"
+		"  -e      enable foreign libraries with -l/-ll\n"
 		"  -f      flush a multipath device map\n"
 		"  -F      flush all multipath device maps\n"
 		"  -a      add a device wwid to the wwids file\n"
@@ -898,6 +899,7 @@ main (int argc, char *argv[])
 	char *dev = NULL;
 	struct config *conf;
 	int retries = -1;
+	bool enable_foreign = false;
 
 	udev = udev_new();
 	logsink = 0;
@@ -907,7 +909,7 @@ main (int argc, char *argv[])
 	multipath_conf = conf;
 	conf->retrigger_tries = 0;
 	conf->force_sync = 1;
-	while ((arg = getopt(argc, argv, ":adcChl::FfM:v:p:b:BrR:itTquUwW")) != EOF ) {
+	while ((arg = getopt(argc, argv, ":adcChl::eFfM:v:p:b:BrR:itTquUwW")) != EOF ) {
 		switch(arg) {
 		case 1: printf("optarg : %s\n",optarg);
 			break;
@@ -1000,6 +1002,9 @@ main (int argc, char *argv[])
 		case 'R':
 			retries = atoi(optarg);
 			break;
+		case 'e':
+			enable_foreign = true;
+			break;
 		case ':':
 			fprintf(stderr, "Missing option argument\n");
 			usage(argv[0]);
@@ -1051,6 +1056,10 @@ main (int argc, char *argv[])
 		condlog(0, "failed to initialize prioritizers");
 		goto out;
 	}
+
+	if ((cmd == CMD_LIST_SHORT || cmd == CMD_LIST_LONG) && enable_foreign)
+		conf->enable_foreign = "";
+
 	/* Failing here is non-fatal */
 	init_foreign(conf->multipath_dir, conf->enable_foreign);
 	if (cmd == CMD_USABLE_PATHS) {
multipath/multipath.8 +6 -0
index 9cdd05a3..6fb8645a 100644
@@ -223,6 +223,12 @@ The verbosity level also controls the level of log and debug messages printed to
 Dry run, do not create or update devmaps.
 .
 .TP
+.B \-e
+Enable all foreign libraries. This overrides the
+.I enable_foreign 
+option from \fBmultipath.conf(5)\fR.
+.
+.TP
 .B \-i
 Ignore WWIDs file when processing devices. If
 \fIfind_multipaths strict\fR or \fIfind_multipaths no\fR is set in
Signature · 1 line
2.26.2
#3 lore raw
In reply to [email protected]

Hi Ben,

Quoted 23 lines · On Fri, 2020-05-08 at 21:33 +0200, [email protected] wrote:

From: Martin Wilck <[email protected]>

Hi Christophe,

This is a follow-up to the previous discussion with topic 'RFC:
multipath-tools: NVMe native multipath and default setting for "enable_foreign"'. Upon Netapp's initiative, I'd asked for foreign libraries to be disabled by default. Ben had replied he'd agree, and suggested implementing a "-e" option for multipath to enable all foreign libraries:

https://www.redhat.com/archives/dm-devel/2020-February/msg00271.html

This patch set implements this idea.

Regards,
Martin

Martin Wilck (2):
libmultipath: set "enable_foreign" to NONE by default
multipath: add "-e" option to enable foreign libraries

Quoted 6 lines
 libmultipath/defaults.h    |  4 ++--
 multipath/main.c           | 11 ++++++++++-
 multipath/multipath.8      |  6 ++++++
 multipath/multipath.conf.5 |  5 +++--
 4 files changed, 21 insertions(+), 5 deletions(-)

this series got no reply from you. Did you miss the post, perhaps?

Thanks,
Martin

maintainer Reviewed-by on the v1 series
#4 lore raw
In reply to [email protected]
Quoted 11 lines · On Fri, May 08, 2020 at 09:33:00PM +0200, [email protected] wrote:

From: Martin Wilck <[email protected]>

Hi Christophe,

This is a follow-up to the previous discussion with topic 'RFC:
multipath-tools: NVMe native multipath and default setting for "enable_foreign"'. Upon Netapp's initiative, I'd asked for foreign libraries to be disabled by default. Ben had replied he'd agree, and suggested implementing a "-e" option for multipath to enable all foreign libraries:

Quoted 4 lines

https://www.redhat.com/archives/dm-devel/2020-February/msg00271.html

This patch set implements this idea.

For the set.

Quoted 16 lines

Regards,
Martin

Martin Wilck (2):
libmultipath: set "enable_foreign" to NONE by default
multipath: add "-e" option to enable foreign libraries

 libmultipath/defaults.h    |  4 ++--
 multipath/main.c           | 11 ++++++++++-
 multipath/multipath.8      |  6 ++++++
 multipath/multipath.conf.5 |  5 +++--
 4 files changed, 21 insertions(+), 5 deletions(-)
Signature · 1 line
2.26.2