Blame SOURCES/0237-RHBZ-1607749-add-transport-blacklist.patch

5d77cd
---
5d77cd
 libmultipath/blacklist.c   |   50 ++++++++++++++++++++++++++----
5d77cd
 libmultipath/blacklist.h   |    3 +
5d77cd
 libmultipath/config.c      |   16 +++++++++
5d77cd
 libmultipath/config.h      |    2 +
5d77cd
 libmultipath/dict.c        |   38 +++++++++++++++++++++--
5d77cd
 libmultipath/discovery.c   |    5 +--
5d77cd
 libmultipath/print.c       |   74 +++++++++++++++++++++++++++++++++++++++++++++
5d77cd
 libmultipath/print.h       |    2 +
5d77cd
 libmultipath/structs.h     |    1 
5d77cd
 multipath/multipath.conf.5 |   15 +++++++++
5d77cd
 10 files changed, 194 insertions(+), 12 deletions(-)
5d77cd
5d77cd
Index: multipath-bz1600672/libmultipath/blacklist.c
5d77cd
===================================================================
5d77cd
--- multipath-bz1600672.orig/libmultipath/blacklist.c
5d77cd
+++ multipath-bz1600672/libmultipath/blacklist.c
5d77cd
@@ -12,6 +12,8 @@
5d77cd
 #include "structs.h"
5d77cd
 #include "config.h"
5d77cd
 #include "blacklist.h"
5d77cd
+#include "structs_vec.h"
5d77cd
+#include "print.h"
5d77cd
 
5d77cd
 extern int
5d77cd
 store_ble (vector blist, char * str, int origin)
5d77cd
@@ -211,12 +213,14 @@ setup_default_blist (struct config * con
5d77cd
 		condlog(3, "%s: (%s) %s", dev, wwid, (M));		 \
5d77cd
 	else if (env)							 \
5d77cd
 		condlog(3, "%s: (%s) %s", dev, env, (M));		 \
5d77cd
+	else if (protocol)						 \
5d77cd
+		condlog(3, "%s: (%s) %s", dev, protocol, (M));		 \
5d77cd
 	else								 \
5d77cd
 		condlog(3, "%s: %s", dev, (M))
5d77cd
 
5d77cd
 void
5d77cd
 log_filter (const char *dev, char *vendor, char *product, char *wwid,
5d77cd
-	    const char *env, int r)
5d77cd
+	    const char *env, char *protocol, int r)
5d77cd
 {
5d77cd
 	/*
5d77cd
 	 * Try to sort from most likely to least.
5d77cd
@@ -236,6 +240,9 @@ log_filter (const char *dev, char *vendo
5d77cd
 	case MATCH_PROPERTY_BLIST:
5d77cd
 		LOG_BLIST("udev property blacklisted");
5d77cd
 		break;
5d77cd
+	case MATCH_PROTOCOL_BLIST:
5d77cd
+		LOG_BLIST("protocol blacklisted");
5d77cd
+		break;
5d77cd
 	case MATCH_DEVICE_BLIST_EXCEPT:
5d77cd
 		LOG_BLIST("vendor/product whitelisted");
5d77cd
 		break;
5d77cd
@@ -251,6 +258,9 @@ log_filter (const char *dev, char *vendo
5d77cd
 	case MATCH_PROPERTY_BLIST_MISSING:
5d77cd
 		LOG_BLIST("blacklisted, udev property missing");
5d77cd
 		break;
5d77cd
+	case MATCH_PROTOCOL_BLIST_EXCEPT:
5d77cd
+		LOG_BLIST("protocol whitelisted");
5d77cd
+		break;
5d77cd
 	}
5d77cd
 }
5d77cd
 
5d77cd
@@ -270,7 +280,7 @@ int
5d77cd
 filter_device (vector blist, vector elist, char * vendor, char * product)
5d77cd
 {
5d77cd
 	int r = _filter_device(blist, elist, vendor, product);
5d77cd
-	log_filter(NULL, vendor, product, NULL, NULL, r);
5d77cd
+	log_filter(NULL, vendor, product, NULL, NULL, NULL, r);
5d77cd
 	return r;
5d77cd
 }
5d77cd
 
5d77cd
@@ -290,7 +300,7 @@ int
5d77cd
 filter_devnode (vector blist, vector elist, char * dev)
5d77cd
 {
5d77cd
 	int r = _filter_devnode(blist, elist, dev);
5d77cd
-	log_filter(dev, NULL, NULL, NULL, NULL, r);
5d77cd
+	log_filter(dev, NULL, NULL, NULL, NULL, NULL, r);
5d77cd
 	return r;
5d77cd
 }
5d77cd
 
5d77cd
@@ -310,7 +320,7 @@ int
5d77cd
 filter_wwid (vector blist, vector elist, char * wwid)
5d77cd
 {
5d77cd
 	int r = _filter_wwid(blist, elist, wwid);
5d77cd
-	log_filter(NULL, NULL, NULL, wwid, NULL, r);
5d77cd
+	log_filter(NULL, NULL, NULL, wwid, NULL, NULL, r);
5d77cd
 	return r;
5d77cd
 }
5d77cd
 
5d77cd
@@ -346,7 +356,7 @@ filter_property(struct config * conf, st
5d77cd
 
5d77cd
 		r = _filter_property(conf, env);
5d77cd
 		if (r) {
5d77cd
-			log_filter(devname, NULL, NULL, NULL, env, r);
5d77cd
+			log_filter(devname, NULL, NULL, NULL, env, NULL, r);
5d77cd
 			return r;
5d77cd
 		}
5d77cd
 	}
5d77cd
@@ -356,13 +366,35 @@ filter_property(struct config * conf, st
5d77cd
 	 * the environment variable _has_ to match.
5d77cd
 	 */
5d77cd
 	if (VECTOR_SIZE(conf->elist_property)) {
5d77cd
-		log_filter(devname, NULL, NULL, NULL, NULL,
5d77cd
+		log_filter(devname, NULL, NULL, NULL, NULL, NULL,
5d77cd
 				MATCH_PROPERTY_BLIST_MISSING);
5d77cd
 		return MATCH_PROPERTY_BLIST_MISSING;
5d77cd
 	}
5d77cd
 	return 0;
5d77cd
 }
5d77cd
 
5d77cd
+static int
5d77cd
+_filter_protocol(vector blist, vector elist, char *protocol_str)
5d77cd
+{
5d77cd
+	if (_blacklist_exceptions(elist, protocol_str))
5d77cd
+		return MATCH_PROTOCOL_BLIST_EXCEPT;
5d77cd
+	if (_blacklist(blist, protocol_str))
5d77cd
+		return MATCH_PROTOCOL_BLIST;
5d77cd
+	return 0;
5d77cd
+}
5d77cd
+
5d77cd
+int
5d77cd
+filter_protocol(vector blist, vector elist, struct path * pp)
5d77cd
+{
5d77cd
+	char buf[PROTOCOL_BUF_SIZE];
5d77cd
+	int r;
5d77cd
+
5d77cd
+	snprint_path_protocol(buf, sizeof(buf), pp);
5d77cd
+	r = _filter_protocol(blist, elist, buf);
5d77cd
+	log_filter(pp->dev, NULL, NULL, NULL, NULL, buf, r);
5d77cd
+	return r;
5d77cd
+}
5d77cd
+
5d77cd
 int
5d77cd
 _filter_path (struct config * conf, struct path * pp)
5d77cd
 {
5d77cd
@@ -371,6 +403,9 @@ _filter_path (struct config * conf, stru
5d77cd
 	r = filter_property(conf, pp->udev);
5d77cd
 	if (r > 0)
5d77cd
 		return r;
5d77cd
+	r = filter_protocol(conf->blist_protocol, conf->elist_protocol, pp);
5d77cd
+	if (r > 0)
5d77cd
+		return r;
5d77cd
 	r = _filter_devnode(conf->blist_devnode, conf->elist_devnode,pp->dev);
5d77cd
 	if (r > 0)
5d77cd
 		return r;
5d77cd
@@ -386,7 +421,8 @@ int
5d77cd
 filter_path (struct config * conf, struct path * pp)
5d77cd
 {
5d77cd
 	int r=_filter_path(conf, pp);
5d77cd
-	log_filter(pp->dev, pp->vendor_id, pp->product_id, pp->wwid, NULL, r);
5d77cd
+	log_filter(pp->dev, pp->vendor_id, pp->product_id, pp->wwid, NULL,
5d77cd
+		   NULL, r);
5d77cd
 	return r;
5d77cd
 }
5d77cd
 
5d77cd
Index: multipath-bz1600672/libmultipath/blacklist.h
5d77cd
===================================================================
5d77cd
--- multipath-bz1600672.orig/libmultipath/blacklist.h
5d77cd
+++ multipath-bz1600672/libmultipath/blacklist.h
5d77cd
@@ -10,10 +10,12 @@
5d77cd
 #define MATCH_DEVNODE_BLIST 3
5d77cd
 #define MATCH_PROPERTY_BLIST 4
5d77cd
 #define MATCH_PROPERTY_BLIST_MISSING 5
5d77cd
+#define MATCH_PROTOCOL_BLIST 6
5d77cd
 #define MATCH_WWID_BLIST_EXCEPT    -MATCH_WWID_BLIST
5d77cd
 #define MATCH_DEVICE_BLIST_EXCEPT  -MATCH_DEVICE_BLIST
5d77cd
 #define MATCH_DEVNODE_BLIST_EXCEPT -MATCH_DEVNODE_BLIST
5d77cd
 #define MATCH_PROPERTY_BLIST_EXCEPT -MATCH_PROPERTY_BLIST
5d77cd
+#define MATCH_PROTOCOL_BLIST_EXCEPT -MATCH_PROTOCOL_BLIST
5d77cd
 
5d77cd
 struct blentry {
5d77cd
 	char * str;
5d77cd
@@ -36,6 +38,7 @@ int filter_wwid (vector, vector, char *)
5d77cd
 int filter_device (vector, vector, char *, char *);
5d77cd
 int filter_path (struct config *, struct path *);
5d77cd
 int filter_property(struct config *, struct udev_device *);
5d77cd
+int filter_protocol(vector, vector, struct path *);
5d77cd
 int store_ble (vector, char *, int);
5d77cd
 int set_ble_device (vector, char *, char *, int);
5d77cd
 void free_blacklist (vector);
5d77cd
Index: multipath-bz1600672/libmultipath/config.c
5d77cd
===================================================================
5d77cd
--- multipath-bz1600672.orig/libmultipath/config.c
5d77cd
+++ multipath-bz1600672/libmultipath/config.c
5d77cd
@@ -598,11 +598,13 @@ free_config (struct config * conf)
5d77cd
 	free_blacklist(conf->blist_devnode);
5d77cd
 	free_blacklist(conf->blist_wwid);
5d77cd
 	free_blacklist(conf->blist_property);
5d77cd
+	free_blacklist(conf->blist_protocol);
5d77cd
 	free_blacklist_device(conf->blist_device);
5d77cd
 
5d77cd
 	free_blacklist(conf->elist_devnode);
5d77cd
 	free_blacklist(conf->elist_wwid);
5d77cd
 	free_blacklist(conf->elist_property);
5d77cd
+	free_blacklist(conf->elist_protocol);
5d77cd
 	free_blacklist_device(conf->elist_device);
5d77cd
 
5d77cd
 	free_mptable(conf->mptable);
5d77cd
@@ -788,6 +790,13 @@ load_config (char * file, struct udev *u
5d77cd
 			goto out;
5d77cd
 	}
5d77cd
 
5d77cd
+	if (conf->blist_protocol == NULL) {
5d77cd
+		conf->blist_protocol = vector_alloc();
5d77cd
+
5d77cd
+		if (!conf->blist_protocol)
5d77cd
+			goto out;
5d77cd
+	}
5d77cd
+
5d77cd
 	if (conf->elist_devnode == NULL) {
5d77cd
 		conf->elist_devnode = vector_alloc();
5d77cd
 
5d77cd
@@ -815,6 +824,13 @@ load_config (char * file, struct udev *u
5d77cd
 			goto out;
5d77cd
 	}
5d77cd
 
5d77cd
+	if (conf->elist_protocol == NULL) {
5d77cd
+		conf->elist_protocol = vector_alloc();
5d77cd
+
5d77cd
+		if (!conf->elist_protocol)
5d77cd
+			goto out;
5d77cd
+	}
5d77cd
+
5d77cd
 	if (setup_default_blist(conf))
5d77cd
 		goto out;
5d77cd
 
5d77cd
Index: multipath-bz1600672/libmultipath/config.h
5d77cd
===================================================================
5d77cd
--- multipath-bz1600672.orig/libmultipath/config.h
5d77cd
+++ multipath-bz1600672/libmultipath/config.h
5d77cd
@@ -190,10 +190,12 @@ struct config {
5d77cd
 	vector blist_wwid;
5d77cd
 	vector blist_device;
5d77cd
 	vector blist_property;
5d77cd
+	vector blist_protocol;
5d77cd
 	vector elist_devnode;
5d77cd
 	vector elist_wwid;
5d77cd
 	vector elist_device;
5d77cd
 	vector elist_property;
5d77cd
+	vector elist_protocol;
5d77cd
 };
5d77cd
 
5d77cd
 struct config * conf;
5d77cd
Index: multipath-bz1600672/libmultipath/dict.c
5d77cd
===================================================================
5d77cd
--- multipath-bz1600672.orig/libmultipath/dict.c
5d77cd
+++ multipath-bz1600672/libmultipath/dict.c
5d77cd
@@ -1065,9 +1065,12 @@ blacklist_handler(vector strvec)
5d77cd
 		conf->blist_device = vector_alloc();
5d77cd
 	if (!conf->blist_property)
5d77cd
 		conf->blist_property = vector_alloc();
5d77cd
+	if (!conf->blist_protocol)
5d77cd
+		conf->blist_protocol = vector_alloc();
5d77cd
 
5d77cd
 	if (!conf->blist_devnode || !conf->blist_wwid ||
5d77cd
-	    !conf->blist_device || !conf->blist_property)
5d77cd
+	    !conf->blist_device || !conf->blist_property ||
5d77cd
+	    !conf->blist_protocol)
5d77cd
 		return 1;
5d77cd
 
5d77cd
 	return 0;
5d77cd
@@ -1084,9 +1087,12 @@ blacklist_exceptions_handler(vector strv
5d77cd
 		conf->elist_device = vector_alloc();
5d77cd
 	if (!conf->elist_property)
5d77cd
 		conf->elist_property = vector_alloc();
5d77cd
+	if (!conf->elist_protocol)
5d77cd
+		conf->elist_protocol = vector_alloc();
5d77cd
 
5d77cd
 	if (!conf->elist_devnode || !conf->elist_wwid ||
5d77cd
-	    !conf->elist_device || !conf->elist_property)
5d77cd
+	    !conf->elist_device || !conf->elist_property ||
5d77cd
+	    !conf->elist_protocol)
5d77cd
 		return 1;
5d77cd
 
5d77cd
 	return 0;
5d77cd
@@ -1171,6 +1177,32 @@ ble_except_property_handler(vector strve
5d77cd
 }
5d77cd
 
5d77cd
 static int
5d77cd
+ble_protocol_handler(vector strvec)
5d77cd
+{
5d77cd
+	char * buff;
5d77cd
+
5d77cd
+	buff = set_value(strvec);
5d77cd
+
5d77cd
+	if (!buff)
5d77cd
+		return 1;
5d77cd
+
5d77cd
+	return store_ble(conf->blist_protocol, buff, ORIGIN_CONFIG);
5d77cd
+}
5d77cd
+
5d77cd
+static int
5d77cd
+ble_except_protocol_handler(vector strvec)
5d77cd
+{
5d77cd
+	char * buff;
5d77cd
+
5d77cd
+	buff = set_value(strvec);
5d77cd
+
5d77cd
+	if (!buff)
5d77cd
+		return 1;
5d77cd
+
5d77cd
+	return store_ble(conf->elist_protocol, buff, ORIGIN_CONFIG);
5d77cd
+}
5d77cd
+
5d77cd
+static int
5d77cd
 ble_device_handler(vector strvec)
5d77cd
 {
5d77cd
 	return alloc_ble_device(conf->blist_device);
5d77cd
@@ -3936,6 +3968,7 @@ init_keywords(void)
5d77cd
 	install_keyword_multi("devnode", &ble_devnode_handler, &snprint_ble_simple);
5d77cd
 	install_keyword_multi("wwid", &ble_wwid_handler, &snprint_ble_simple);
5d77cd
 	install_keyword_multi("property", &ble_property_handler, &snprint_ble_simple);
5d77cd
+	install_keyword_multi("protocol", &ble_protocol_handler, &snprint_ble_simple);
5d77cd
 	install_keyword_multi("device", &ble_device_handler, NULL);
5d77cd
 	install_sublevel();
5d77cd
 	install_keyword("vendor", &ble_vendor_handler, &snprint_bled_vendor);
5d77cd
@@ -3945,6 +3978,7 @@ init_keywords(void)
5d77cd
 	install_keyword_multi("devnode", &ble_except_devnode_handler, &snprint_ble_simple);
5d77cd
 	install_keyword_multi("wwid", &ble_except_wwid_handler, &snprint_ble_simple);
5d77cd
 	install_keyword_multi("property", &ble_except_property_handler, &snprint_ble_simple);
5d77cd
+	install_keyword_multi("protocol", &ble_except_protocol_handler, &snprint_ble_simple);
5d77cd
 	install_keyword_multi("device", &ble_except_device_handler, NULL);
5d77cd
 	install_sublevel();
5d77cd
 	install_keyword("vendor", &ble_except_vendor_handler, &snprint_bled_vendor);
5d77cd
Index: multipath-bz1600672/libmultipath/discovery.c
5d77cd
===================================================================
5d77cd
--- multipath-bz1600672.orig/libmultipath/discovery.c
5d77cd
+++ multipath-bz1600672/libmultipath/discovery.c
5d77cd
@@ -1489,9 +1489,10 @@ pathinfo (struct path *pp, vector hwtabl
5d77cd
 
5d77cd
 	if (mask & DI_BLACKLIST && mask & DI_SYSFS) {
5d77cd
 		if (filter_device(conf->blist_device, conf->elist_device,
5d77cd
-				  pp->vendor_id, pp->product_id) > 0) {
5d77cd
+				  pp->vendor_id, pp->product_id) > 0 ||
5d77cd
+		    filter_protocol(conf->blist_protocol, conf->elist_protocol,
5d77cd
+				    pp) > 0)
5d77cd
 			return PATHINFO_SKIPPED;
5d77cd
-		}
5d77cd
 	}
5d77cd
 
5d77cd
 	path_state = path_offline(pp);
5d77cd
Index: multipath-bz1600672/libmultipath/print.c
5d77cd
===================================================================
5d77cd
--- multipath-bz1600672.orig/libmultipath/print.c
5d77cd
+++ multipath-bz1600672/libmultipath/print.c
5d77cd
@@ -601,6 +601,48 @@ snprint_path_checker (char * buff, size_
5d77cd
 	return snprint_str(buff, len, c->name);
5d77cd
 }
5d77cd
 
5d77cd
+/* if you add a protocol string bigger than "scsi:unspec" you must
5d77cd
+ * also change PROTOCOL_BUF_SIZE */
5d77cd
+int
5d77cd
+snprint_path_protocol(char * buff, size_t len, struct path * pp)
5d77cd
+{
5d77cd
+	switch (pp->bus) {
5d77cd
+	case SYSFS_BUS_SCSI:
5d77cd
+		switch (pp->sg_id.proto_id) {
5d77cd
+		case SCSI_PROTOCOL_FCP:
5d77cd
+			return snprintf(buff, len, "scsi:fcp");
5d77cd
+		case SCSI_PROTOCOL_SPI:
5d77cd
+			return snprintf(buff, len, "scsi:spi");
5d77cd
+		case SCSI_PROTOCOL_SSA:
5d77cd
+			return snprintf(buff, len, "scsi:ssa");
5d77cd
+		case SCSI_PROTOCOL_SBP:
5d77cd
+			return snprintf(buff, len, "scsi:sbp");
5d77cd
+		case SCSI_PROTOCOL_SRP:
5d77cd
+			return snprintf(buff, len, "scsi:srp");
5d77cd
+		case SCSI_PROTOCOL_ISCSI:
5d77cd
+			return snprintf(buff, len, "scsi:iscsi");
5d77cd
+		case SCSI_PROTOCOL_SAS:
5d77cd
+			return snprintf(buff, len, "scsi:sas");
5d77cd
+		case SCSI_PROTOCOL_ADT:
5d77cd
+			return snprintf(buff, len, "scsi:adt");
5d77cd
+		case SCSI_PROTOCOL_ATA:
5d77cd
+			return snprintf(buff, len, "scsi:ata");
5d77cd
+		case SCSI_PROTOCOL_UNSPEC:
5d77cd
+		default:
5d77cd
+			return snprintf(buff, len, "scsi:unspec");
5d77cd
+		}
5d77cd
+	case SYSFS_BUS_CCW:
5d77cd
+		return snprintf(buff, len, "ccw");
5d77cd
+	case SYSFS_BUS_CCISS:
5d77cd
+		return snprintf(buff, len, "cciss");
5d77cd
+	case SYSFS_BUS_NVME:
5d77cd
+		return snprintf(buff, len, "nvme");
5d77cd
+	case SYSFS_BUS_UNDEF:
5d77cd
+	default:
5d77cd
+		return snprintf(buff, len, "undef");
5d77cd
+	}
5d77cd
+}
5d77cd
+
5d77cd
 struct multipath_data mpd[] = {
5d77cd
 	{'n', "name",          0, snprint_name},
5d77cd
 	{'w', "uuid",          0, snprint_multipath_uuid},
5d77cd
@@ -647,6 +689,7 @@ struct path_data pd[] = {
5d77cd
 	{'R', "host WWPN",     0, snprint_host_wwpn},
5d77cd
 	{'r', "target WWPN",   0, snprint_tgt_wwpn},
5d77cd
 	{'a', "host adapter",  0, snprint_host_adapter},
5d77cd
+	{'P', "protocol",      0, snprint_path_protocol},
5d77cd
 	{0, NULL, 0 , NULL}
5d77cd
 };
5d77cd
 
5d77cd
@@ -1428,6 +1471,19 @@ snprint_blacklist_report (char * buff, i
5d77cd
 
5d77cd
 	if ((len - fwd - threshold) <= 0)
5d77cd
 		return len;
5d77cd
+	fwd += snprintf(buff + fwd, len - fwd, "protocol rules:\n"
5d77cd
+					       "- blacklist:\n");
5d77cd
+	if (!snprint_blacklist_group(buff, len, &fwd, &conf->blist_protocol))
5d77cd
+		return len;
5d77cd
+
5d77cd
+	if ((len - fwd - threshold) <= 0)
5d77cd
+		return len;
5d77cd
+	fwd += snprintf(buff + fwd, len - fwd, "- exceptions:\n");
5d77cd
+	if (snprint_blacklist_group(buff, len, &fwd, &conf->elist_protocol) == 0)
5d77cd
+		return len;
5d77cd
+
5d77cd
+	if ((len - fwd - threshold) <= 0)
5d77cd
+		return len;
5d77cd
 	fwd += snprintf(buff + fwd, len - fwd, "wwid rules:\n"
5d77cd
 					       "- blacklist:\n");
5d77cd
 	if (snprint_blacklist_group(buff, len, &fwd, &conf->blist_wwid) == 0)
5d77cd
@@ -1502,6 +1558,15 @@ snprint_blacklist (char * buff, int len)
5d77cd
 		if (fwd > len)
5d77cd
 			return len;
5d77cd
 	}
5d77cd
+	vector_foreach_slot (conf->blist_protocol, ble, i) {
5d77cd
+		kw = find_keyword(rootkw->sub, "protocol");
5d77cd
+		if (!kw)
5d77cd
+			return 0;
5d77cd
+		fwd += snprint_keyword(buff + fwd, len - fwd, "\t%k %v\n",
5d77cd
+				       kw, ble);
5d77cd
+		if (fwd > len)
5d77cd
+			return len;
5d77cd
+	}
5d77cd
 	rootkw = find_keyword(rootkw->sub, "device");
5d77cd
 	if (!rootkw)
5d77cd
 		return 0;
5d77cd
@@ -1575,6 +1640,15 @@ snprint_blacklist_except (char * buff, i
5d77cd
 		if (!kw)
5d77cd
 			return 0;
5d77cd
 		fwd += snprint_keyword(buff + fwd, len - fwd, "\t%k %v\n",
5d77cd
+				       kw, ele);
5d77cd
+		if (fwd > len)
5d77cd
+			return len;
5d77cd
+	}
5d77cd
+	vector_foreach_slot (conf->elist_protocol, ele, i) {
5d77cd
+		kw = find_keyword(rootkw->sub, "protocol");
5d77cd
+		if (!kw)
5d77cd
+			return 0;
5d77cd
+		fwd += snprint_keyword(buff + fwd, len - fwd, "\t%k %v\n",
5d77cd
 				       kw, ele);
5d77cd
 		if (fwd > len)
5d77cd
 			return len;
5d77cd
Index: multipath-bz1600672/libmultipath/print.h
5d77cd
===================================================================
5d77cd
--- multipath-bz1600672.orig/libmultipath/print.h
5d77cd
+++ multipath-bz1600672/libmultipath/print.h
5d77cd
@@ -115,6 +115,8 @@ int snprint_host_wwnn (char *, size_t, s
5d77cd
 int snprint_host_wwpn (char *, size_t, struct path *);
5d77cd
 int snprint_tgt_wwnn (char *, size_t, struct path *);
5d77cd
 int snprint_tgt_wwpn (char *, size_t, struct path *);
5d77cd
+#define PROTOCOL_BUF_SIZE sizeof("scsi:unspec")
5d77cd
+int snprint_path_protocol(char *, size_t, struct path *);
5d77cd
 
5d77cd
 void print_multipath_topology (struct multipath * mpp, int verbosity);
5d77cd
 void print_path (struct path * pp, char * style);
5d77cd
Index: multipath-bz1600672/libmultipath/structs.h
5d77cd
===================================================================
5d77cd
--- multipath-bz1600672.orig/libmultipath/structs.h
5d77cd
+++ multipath-bz1600672/libmultipath/structs.h
5d77cd
@@ -50,7 +50,6 @@ enum failback_mode {
5d77cd
 enum sysfs_buses {
5d77cd
 	SYSFS_BUS_UNDEF,
5d77cd
 	SYSFS_BUS_SCSI,
5d77cd
-	SYSFS_BUS_IDE,
5d77cd
 	SYSFS_BUS_CCW,
5d77cd
 	SYSFS_BUS_CCISS,
5d77cd
 	SYSFS_BUS_RBD,
5d77cd
Index: multipath-bz1600672/multipath/multipath.conf.5
5d77cd
===================================================================
5d77cd
--- multipath-bz1600672.orig/multipath/multipath.conf.5
5d77cd
+++ multipath-bz1600672/multipath/multipath.conf.5
5d77cd
@@ -632,6 +632,10 @@ Regular expression of the device nodes t
5d77cd
 .B property
5d77cd
 Regular expresion of the udev property to be excluded.
5d77cd
 .TP
5d77cd
+.B protocol
5d77cd
+Regular expression of the protocol to be excluded. See below for a
5d77cd
+list of recognized protocols
5d77cd
+.TP
5d77cd
 .B device
5d77cd
 Subsection for the device description. This subsection recognizes the
5d77cd
 .I vendor
5d77cd
@@ -640,6 +644,13 @@ and
5d77cd
 keywords. For a full description of these keywords please see the
5d77cd
 .I devices
5d77cd
 section description.
5d77cd
+.LP
5d77cd
+The protocol strings that multipath recognizes are \fIscsi:fcp\fR,
5d77cd
+\fIscsi:spi\fR, \fIscsi:ssa\fR, \fIscsi:sbp\fR, \fIscsi:srp\fR,
5d77cd
+\fIscsi:iscsi\fR, \fIscsi:sas\fR, \fIscsi:adt\fR, \fIscsi:ata\fR,
5d77cd
+\fIscsi:unspec\fR, \fIccw\fR, \fIcciss\fR, \fInvme\fR, and \fIundef\fR.
5d77cd
+The protocol that a path is using can be viewed by running
5d77cd
+\fBmultipathd show paths format "%d %P"\fR
5d77cd
 .SH "blacklist_exceptions section"
5d77cd
 The
5d77cd
 .I blacklist_exceptions
5d77cd
@@ -659,6 +670,10 @@ The \fIWorld Wide Identification\fR of a
5d77cd
 .B property
5d77cd
 Regular expresion of the udev property to be whitelisted.
5d77cd
 .TP
5d77cd
+.B protocol
5d77cd
+Regular expression of the protocol to be whitelisted. See the
5d77cd
+\fBblacklist section\fR for a list of recognized protocols
5d77cd
+.TP
5d77cd
 .B devnode
5d77cd
 Regular expression of the device nodes to be whitelisted.
5d77cd
 .TP