[PATCH v2 34/37] libmultipath: print built-in values for deprecated options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Martin Wilck <mwilck@xxxxxxxx>

In the error messages we print when a deprecated option is encountered,
print the compile-time value of the option.

Signed-off-by: Martin Wilck <mwilck@xxxxxxxx>
---
 libmultipath/dict.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/libmultipath/dict.c b/libmultipath/dict.c
index f81c84a..dace343 100644
--- a/libmultipath/dict.c
+++ b/libmultipath/dict.c
@@ -314,14 +314,16 @@ def_ ## option ## _handler (struct config *conf, vector strvec,		\
 static int deprecated_handler(struct config *conf, vector strvec, const char *file,
 			      int line_nr);
 
-#define declare_deprecated_handler(option)				\
+#define declare_deprecated_handler(option, default)				\
 static int								\
 deprecated_ ## option ## _handler (struct config *conf, vector strvec,	\
 				   const char *file, int line_nr)	\
 {									\
 	static bool warned;						\
 	if (!warned) {							\
-		condlog(1, "%s line %d: ignoring deprecated option \"" #option "\"", file, line_nr); \
+		condlog(1, "%s line %d: ignoring deprecated option \""	\
+			#option "\", using built-in value: \"%s\"",	\
+			file, line_nr, default);			\
 		warned = true;						\
 	}								\
 	return deprecated_handler(conf, strvec, file, line_nr);		\
@@ -2057,11 +2059,11 @@ snprint_deprecated (struct config *conf, struct strbuf *buff, const void * data)
 }
 
 // Deprecated keywords
-declare_deprecated_handler(config_dir)
-declare_deprecated_handler(disable_changed_wwids)
-declare_deprecated_handler(getuid_callout)
-declare_deprecated_handler(multipath_dir)
-declare_deprecated_handler(pg_timeout)
+declare_deprecated_handler(config_dir, CONFIG_DIR)
+declare_deprecated_handler(disable_changed_wwids, "yes")
+declare_deprecated_handler(getuid_callout, "(not set)")
+declare_deprecated_handler(multipath_dir, MULTIPATH_DIR)
+declare_deprecated_handler(pg_timeout, "(not set)")
 
 /*
  * If you add or remove a keyword also update multipath/multipath.conf.5
-- 
2.42.0

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux