Blame SOURCES/0246-RHBZ-1593459-add-transport-blacklist.patch

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