Update Source to latest upstream commit * Previous patches 0001-0018 are included in this commit Rename files * Previous patches 0019-0028 are now patches 0002-0003 & 0012-0019 Add 0001-libmultipath-remove-last-of-rbd-code.patch Add 0004-mpathpersist-add-param-alltgpt-option.patch * mpathpersist now accepts --param-alltgpt Add 0005-libmutipath-remove-unused-IDE-bus-type.patch Add 0006-multipathd-add-new-protocol-path-wildcard.patch * multipathd show paths format now accepts %P for the path * protocol/transport Add 0007-libmultipath-add-protocol-blacklist-option.patch * You can now use the "protocol" blacklist section parameter to * blacklist by protocol/transport Add 0008-libmultipath-remove-_filter_-blacklist-functions.patch Add 0009-multipath-tests-change-to-work-with-old-make-version.patch Add 0010-multipath-tests-add-blacklist-tests.patch Add 0011-mpathpersist-add-missing-param-rk-usage-info.patch Refresh 0013-RH-Remove-the-property-blacklist-exception-builtin.patch Modify 0016-RH-add-mpathconf.patch * improve usage message and man page
93 lines
3.1 KiB
Diff
93 lines
3.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Benjamin Marzinski <bmarzins@redhat.com>
|
|
Date: Tue, 26 Jun 2018 17:04:57 -0500
|
|
Subject: [PATCH] multipathd: add new protocol path wildcard
|
|
|
|
This patch adds a new path wildcard 'P', that will print the path's
|
|
protocol. For scsi devices, it will additionally print the transport
|
|
protocol being used.
|
|
|
|
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|
---
|
|
libmultipath/print.c | 43 +++++++++++++++++++++++++++++++++++++++++++
|
|
libmultipath/print.h | 2 ++
|
|
2 files changed, 45 insertions(+)
|
|
|
|
diff --git a/libmultipath/print.c b/libmultipath/print.c
|
|
index 222d270..ecfcb48 100644
|
|
--- a/libmultipath/print.c
|
|
+++ b/libmultipath/print.c
|
|
@@ -638,6 +638,48 @@ snprint_path_failures(char * buff, size_t len, const struct path * pp)
|
|
return snprint_int(buff, len, pp->failcount);
|
|
}
|
|
|
|
+/* if you add a protocol string bigger than "scsi:unspec" you must
|
|
+ * also change PROTOCOL_BUF_SIZE */
|
|
+int
|
|
+snprint_path_protocol(char * buff, size_t len, const struct path * pp)
|
|
+{
|
|
+ switch (pp->bus) {
|
|
+ case SYSFS_BUS_SCSI:
|
|
+ switch (pp->sg_id.proto_id) {
|
|
+ case SCSI_PROTOCOL_FCP:
|
|
+ return snprintf(buff, len, "scsi:fcp");
|
|
+ case SCSI_PROTOCOL_SPI:
|
|
+ return snprintf(buff, len, "scsi:spi");
|
|
+ case SCSI_PROTOCOL_SSA:
|
|
+ return snprintf(buff, len, "scsi:ssa");
|
|
+ case SCSI_PROTOCOL_SBP:
|
|
+ return snprintf(buff, len, "scsi:sbp");
|
|
+ case SCSI_PROTOCOL_SRP:
|
|
+ return snprintf(buff, len, "scsi:srp");
|
|
+ case SCSI_PROTOCOL_ISCSI:
|
|
+ return snprintf(buff, len, "scsi:iscsi");
|
|
+ case SCSI_PROTOCOL_SAS:
|
|
+ return snprintf(buff, len, "scsi:sas");
|
|
+ case SCSI_PROTOCOL_ADT:
|
|
+ return snprintf(buff, len, "scsi:adt");
|
|
+ case SCSI_PROTOCOL_ATA:
|
|
+ return snprintf(buff, len, "scsi:ata");
|
|
+ case SCSI_PROTOCOL_UNSPEC:
|
|
+ default:
|
|
+ return snprintf(buff, len, "scsi:unspec");
|
|
+ }
|
|
+ case SYSFS_BUS_CCW:
|
|
+ return snprintf(buff, len, "ccw");
|
|
+ case SYSFS_BUS_CCISS:
|
|
+ return snprintf(buff, len, "cciss");
|
|
+ case SYSFS_BUS_NVME:
|
|
+ return snprintf(buff, len, "nvme");
|
|
+ case SYSFS_BUS_UNDEF:
|
|
+ default:
|
|
+ return snprintf(buff, len, "undef");
|
|
+ }
|
|
+}
|
|
+
|
|
struct multipath_data mpd[] = {
|
|
{'n', "name", 0, snprint_name},
|
|
{'w', "uuid", 0, snprint_multipath_uuid},
|
|
@@ -687,6 +729,7 @@ struct path_data pd[] = {
|
|
{'a', "host adapter", 0, snprint_host_adapter},
|
|
{'G', "foreign", 0, snprint_path_foreign},
|
|
{'0', "failures", 0, snprint_path_failures},
|
|
+ {'P', "protocol", 0, snprint_path_protocol},
|
|
{0, NULL, 0 , NULL}
|
|
};
|
|
|
|
diff --git a/libmultipath/print.h b/libmultipath/print.h
|
|
index 608b7d5..e2fb865 100644
|
|
--- a/libmultipath/print.h
|
|
+++ b/libmultipath/print.h
|
|
@@ -133,6 +133,8 @@ int snprint_host_wwnn (char *, size_t, const struct path *);
|
|
int snprint_host_wwpn (char *, size_t, const struct path *);
|
|
int snprint_tgt_wwnn (char *, size_t, const struct path *);
|
|
int snprint_tgt_wwpn (char *, size_t, const struct path *);
|
|
+#define PROTOCOL_BUF_SIZE sizeof("scsi:unspec")
|
|
+int snprint_path_protocol(char *, size_t, const struct path *);
|
|
|
|
void _print_multipath_topology (const struct gen_multipath * gmp,
|
|
int verbosity);
|
|
--
|
|
2.7.4
|
|
|