[dm-devel] [PATCH v2 1/3] Add %g format specifier to 'multipathd show paths format' command

Todd Gill tgill at redhat.com
Tue Feb 9 19:49:16 UTC 2016


The %g specifier will print the group number of the path when used with
multipathd show paths format.

Signed-off-by: Todd Gill <tgill at redhat.com>
Signed-off-by: Gris Ge <fge at redhat.com>
---
 libmultipath/print.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libmultipath/print.c b/libmultipath/print.c
index 6215d0b..c313e3e 100644
--- a/libmultipath/print.c
+++ b/libmultipath/print.c
@@ -293,6 +293,11 @@ snprint_path_uuid (char * buff, size_t len, struct path * pp)
 	return snprint_str(buff, len, pp->wwid);
 }
 
+static int snprint_path_groupnumber(char * buff, size_t len, struct path * pp)
+{
+	return snprint_int(buff, len, pp->pgindex);
+}
+
 static int
 snprint_hcil (char * buff, size_t len, struct path * pp)
 {
@@ -576,6 +581,7 @@ struct path_data pd[] = {
 	{'i', "hcil",          0, snprint_hcil},
 	{'d', "dev",           0, snprint_dev},
 	{'D', "dev_t",         0, snprint_dev_t},
+	{'g', "group",         0, snprint_path_groupnumber},
 	{'t', "dm_st",         0, snprint_dm_path_state},
 	{'o', "dev_st",        0, snprint_offline},
 	{'T', "chk_st",        0, snprint_chk_state},
-- 
2.5.0




More information about the dm-devel mailing list