9ae3e98286
Add 0110-libmultipath-keep-track-of-queueing-state-in-feature.patch Add 0111-libmultipath-export-partmap_in_use.patch Add 0112-libmultipath-change-flush_on_last_del-to-fix-a-multi.patch Add 0113-libmultipath-pad-dev_loss_tmo-to-avoid-race-with-no_.patch * Fixes RHEL-30272 Add 0114-libmultipath-remove-pathgroup-wildcard-options.patch Add 0115-libmultipath-print-all-values-in-snprint_failback.patch Add 0116-multipathd-Stop-double-counting-map-failures-for-no_.patch Add 0117-multipath-tools-man-pages-add-missing-multipathd-com.patch Add 0118-libmultipath-change-the-vend-prod-rev-printing.patch Add 0119-multipath-tools-man-pages-Add-format-wildcard-descri.patch * Fixes RHEL-8304 Resolves: RHEL-8304 Resolves: RHEL-30272
55 lines
2.2 KiB
Diff
55 lines
2.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Benjamin Marzinski <bmarzins@redhat.com>
|
|
Date: Fri, 10 May 2024 15:36:10 -0400
|
|
Subject: [PATCH] libmultipath: change the vend/prod/rev printing
|
|
|
|
The %s multipath and path wildcards both say they print the device
|
|
vend/prod/rev string, but neither of them do. The multipath wildcards
|
|
already provide a way to print the revision string and the %s wildcard
|
|
is used in the multipath -l output, so leave the wildcard output alone,
|
|
and change the description to only mention the vendor and product. There
|
|
is no other way to print the revision by path, and the path %s wildcard
|
|
is only used in the verbose multipath output, so make it actually print
|
|
the revision. Also check for unset strings, and print "##" instead of
|
|
nothing.
|
|
|
|
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|
---
|
|
libmultipath/print.c | 9 ++++++---
|
|
1 file changed, 6 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/libmultipath/print.c b/libmultipath/print.c
|
|
index 535e0271..4552fd43 100644
|
|
--- a/libmultipath/print.c
|
|
+++ b/libmultipath/print.c
|
|
@@ -309,7 +309,7 @@ snprint_multipath_uuid (struct strbuf *buff, const struct multipath * mpp)
|
|
}
|
|
|
|
static int
|
|
-snprint_multipath_vpr (struct strbuf *buff, const struct multipath * mpp)
|
|
+snprint_multipath_vp (struct strbuf *buff, const struct multipath * mpp)
|
|
{
|
|
struct pathgroup * pgp;
|
|
struct path * pp;
|
|
@@ -511,7 +511,10 @@ snprint_dm_path_state (struct strbuf *buff, const struct path * pp)
|
|
static int
|
|
snprint_vpr (struct strbuf *buff, const struct path * pp)
|
|
{
|
|
- return print_strbuf(buff, "%s,%s", pp->vendor_id, pp->product_id);
|
|
+ return print_strbuf(buff, "%s,%s,%s",
|
|
+ strlen(pp->vendor_id) ? pp->vendor_id : "##",
|
|
+ strlen(pp->product_id) ? pp->product_id : "##",
|
|
+ strlen(pp->rev) ? pp->rev : "##");
|
|
}
|
|
|
|
static int
|
|
@@ -743,7 +746,7 @@ struct multipath_data mpd[] = {
|
|
{'2', "map_loads", 0, snprint_map_loads},
|
|
{'3', "total_q_time", 0, snprint_total_q_time},
|
|
{'4', "q_timeouts", 0, snprint_q_timeouts},
|
|
- {'s', "vend/prod/rev", 0, snprint_multipath_vpr},
|
|
+ {'s', "vend/prod", 0, snprint_multipath_vp},
|
|
{'v', "vend", 0, snprint_multipath_vend},
|
|
{'p', "prod", 0, snprint_multipath_prod},
|
|
{'e', "rev", 0, snprint_multipath_rev},
|