代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/multipath-tools 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。