Blame SOURCES/0029-libmultipath-deprecate-file-and-directory-config-opt.patch

ebef98
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
ebef98
From: Benjamin Marzinski <bmarzins@redhat.com>
ebef98
Date: Wed, 10 Nov 2021 18:34:08 -0600
ebef98
Subject: [PATCH] libmultipath: deprecate file and directory config options
ebef98
ebef98
Having multipath able to select pathnames for the files and directories
ebef98
it needs causes unnecessary maintainer headaches. Mark these as
ebef98
deprecated, but still support them for now.
ebef98
ebef98
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
ebef98
---
ebef98
 libmultipath/dict.c        | 19 +++++++++++++++----
ebef98
 multipath/multipath.conf.5 |  5 +++++
ebef98
 2 files changed, 20 insertions(+), 4 deletions(-)
ebef98
ebef98
diff --git a/libmultipath/dict.c b/libmultipath/dict.c
ebef98
index 149d3348..d14be340 100644
ebef98
--- a/libmultipath/dict.c
ebef98
+++ b/libmultipath/dict.c
ebef98
@@ -268,6 +268,15 @@ def_ ## option ## _handler (struct config *conf, vector strvec,		\
ebef98
 	return function (strvec, &conf->option, file, line_nr);		\
ebef98
 }
ebef98
 
ebef98
+#define declare_def_warn_handler(option, function)			\
ebef98
+static int								\
ebef98
+def_ ## option ## _handler (struct config *conf, vector strvec,		\
ebef98
+			    const char *file, int line_nr)		\
ebef98
+{									\
ebef98
+	condlog(2, "%s line %d, \"" #option "\" is deprecated and will be disabled in a future release", file, line_nr);				\
ebef98
+	return function (strvec, &conf->option, file, line_nr);		\
ebef98
+}
ebef98
+
ebef98
 #define declare_def_range_handler(option, minval, maxval)			\
ebef98
 static int								\
ebef98
 def_ ## option ## _handler (struct config *conf, vector strvec,         \
ebef98
@@ -421,7 +430,7 @@ declare_def_snprint(verbosity, print_int)
ebef98
 declare_def_handler(reassign_maps, set_yes_no)
ebef98
 declare_def_snprint(reassign_maps, print_yes_no)
ebef98
 
ebef98
-declare_def_handler(multipath_dir, set_dir)
ebef98
+declare_def_warn_handler(multipath_dir, set_dir)
ebef98
 declare_def_snprint(multipath_dir, print_str)
ebef98
 
ebef98
 static int def_partition_delim_handler(struct config *conf, vector strvec,
ebef98
@@ -654,13 +663,13 @@ declare_hw_snprint(user_friendly_names, print_yes_no_undef)
ebef98
 declare_mp_handler(user_friendly_names, set_yes_no_undef)
ebef98
 declare_mp_snprint(user_friendly_names, print_yes_no_undef)
ebef98
 
ebef98
-declare_def_handler(bindings_file, set_path)
ebef98
+declare_def_warn_handler(bindings_file, set_path)
ebef98
 declare_def_snprint(bindings_file, print_str)
ebef98
 
ebef98
-declare_def_handler(wwids_file, set_path)
ebef98
+declare_def_warn_handler(wwids_file, set_path)
ebef98
 declare_def_snprint(wwids_file, print_str)
ebef98
 
ebef98
-declare_def_handler(prkeys_file, set_path)
ebef98
+declare_def_warn_handler(prkeys_file, set_path)
ebef98
 declare_def_snprint(prkeys_file, print_str)
ebef98
 
ebef98
 declare_def_handler(retain_hwhandler, set_yes_no_undef)
ebef98
@@ -760,6 +769,8 @@ def_config_dir_handler(struct config *conf, vector strvec, const char *file,
ebef98
 	/* this is only valid in the main config file */
ebef98
 	if (conf->processed_main_config)
ebef98
 		return 0;
ebef98
+	condlog(2, "%s line %d, \"config_dir\" is deprecated and will be disabled in a future release",
ebef98
+		file, line_nr);
ebef98
 	return set_path(strvec, &conf->config_dir, file, line_nr);
ebef98
 }
ebef98
 declare_def_snprint(config_dir, print_str)
ebef98
diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5
ebef98
index dd9f4dc7..7f85f766 100644
ebef98
--- a/multipath/multipath.conf.5
ebef98
+++ b/multipath/multipath.conf.5
ebef98
@@ -178,6 +178,7 @@ The default is: \fBno\fR
ebef98
 .
ebef98
 .TP
ebef98
 .B multipath_dir
ebef98
+This option is deprecated, and will be removed in a future release.
ebef98
 Directory where the dynamic shared objects are stored. Defined at compile time,
ebef98
 commonly \fI/lib64/multipath/\fR or \fI/lib/multipath/\fR.
ebef98
 .RS
ebef98
@@ -742,6 +743,7 @@ The default is: \fB<unset>\fR
ebef98
 .
ebef98
 .TP
ebef98
 .B bindings_file
ebef98
+This option is deprecated, and will be removed in a future release.
ebef98
 The full pathname of the binding file to be used when the user_friendly_names
ebef98
 option is set.
ebef98
 .RS
ebef98
@@ -752,6 +754,7 @@ The default is: \fB/etc/multipath/bindings\fR
ebef98
 .
ebef98
 .TP
ebef98
 .B wwids_file
ebef98
+This option is deprecated, and will be removed in a future release.
ebef98
 The full pathname of the WWIDs file, which is used by multipath to keep track
ebef98
 of the WWIDs for LUNs it has created multipath devices on in the past.
ebef98
 .RS
ebef98
@@ -762,6 +765,7 @@ The default is: \fB/etc/multipath/wwids\fR
ebef98
 .
ebef98
 .TP
ebef98
 .B prkeys_file
ebef98
+This option is deprecated, and will be removed in a future release.
ebef98
 The full pathname of the prkeys file, which is used by multipathd to keep
ebef98
 track of the persistent reservation key used for a specific WWID, when
ebef98
 \fIreservation_key\fR is set to \fBfile\fR.
ebef98
@@ -933,6 +937,7 @@ The default is: \fB<unset>\fR
ebef98
 .
ebef98
 .TP
ebef98
 .B config_dir
ebef98
+This option is deprecated, and will be removed in a future release.
ebef98
 If set to anything other than "", multipath will search this directory
ebef98
 alphabetically for file ending in ".conf" and it will read configuration
ebef98
 information from them, just as if it was in \fI/etc/multipath.conf\fR.