device-mapper-multipath/0034-libmultipath-print-built-in-values-for-deprecated-op.patch
Benjamin Marzinski e5eddaae1a device-mapper-multipath-0.9.6-1
Update to the head of the upstream staging branch
Rename redhat patches
  * Previous patches 0001-0012 are now patches 0041-0052
Add 0053-RH-Add-mpathcleanup.patch
  * add mpathcleanup program
2023-09-22 15:29:43 -05:00

56 lines
2.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Mon, 11 Sep 2023 11:36:25 +0200
Subject: [PATCH] libmultipath: print built-in values for deprecated options
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@suse.com>
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/dict.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/libmultipath/dict.c b/libmultipath/dict.c
index f81c84aa..dace343d 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