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

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