Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25cca89fbe |
4 changed files with 569 additions and 1 deletions
25
0023-libmutipath-remove-unused-IDE-bus-type.patch
Normal file
25
0023-libmutipath-remove-unused-IDE-bus-type.patch
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
Date: Tue, 26 Jun 2018 16:45:48 -0500
|
||||
Subject: [PATCH] libmutipath: remove unused IDE bus type
|
||||
|
||||
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
---
|
||||
libmultipath/structs.h | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/libmultipath/structs.h b/libmultipath/structs.h
|
||||
index bfa660a..3824f75 100644
|
||||
--- a/libmultipath/structs.h
|
||||
+++ b/libmultipath/structs.h
|
||||
@@ -52,7 +52,6 @@ enum failback_mode {
|
||||
enum sysfs_buses {
|
||||
SYSFS_BUS_UNDEF,
|
||||
SYSFS_BUS_SCSI,
|
||||
- SYSFS_BUS_IDE,
|
||||
SYSFS_BUS_CCW,
|
||||
SYSFS_BUS_CCISS,
|
||||
SYSFS_BUS_RBD,
|
||||
--
|
||||
2.7.4
|
||||
|
||||
92
0024-multipathd-add-new-protocol-path-wildcard.patch
Normal file
92
0024-multipathd-add-new-protocol-path-wildcard.patch
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
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 65a9824..00739bc 100644
|
||||
--- a/libmultipath/print.c
|
||||
+++ b/libmultipath/print.c
|
||||
@@ -623,6 +623,48 @@ snprint_path_checker (char * buff, size_t len, struct path * pp)
|
||||
return snprint_str(buff, len, c->name);
|
||||
}
|
||||
|
||||
+/* 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, 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},
|
||||
@@ -669,6 +711,7 @@ struct path_data pd[] = {
|
||||
{'R', "host WWPN", 0, snprint_host_wwpn},
|
||||
{'r', "target WWPN", 0, snprint_tgt_wwpn},
|
||||
{'a', "host adapter", 0, snprint_host_adapter},
|
||||
+ {'P', "protocol", 0, snprint_path_protocol},
|
||||
{0, NULL, 0 , NULL}
|
||||
};
|
||||
|
||||
diff --git a/libmultipath/print.h b/libmultipath/print.h
|
||||
index b8c3436..d166b5c 100644
|
||||
--- a/libmultipath/print.h
|
||||
+++ b/libmultipath/print.h
|
||||
@@ -117,6 +117,8 @@ int snprint_host_wwnn (char *, size_t, struct path *);
|
||||
int snprint_host_wwpn (char *, size_t, struct path *);
|
||||
int snprint_tgt_wwnn (char *, size_t, struct path *);
|
||||
int snprint_tgt_wwpn (char *, size_t, struct path *);
|
||||
+#define PROTOCOL_BUF_SIZE sizeof("scsi:unspec")
|
||||
+int snprint_path_protocol(char *, size_t, struct path *);
|
||||
|
||||
void print_multipath_topology (struct multipath * mpp, int verbosity);
|
||||
void print_path (struct path * pp, char * style);
|
||||
--
|
||||
2.7.4
|
||||
|
||||
437
0025-libmultipath-add-protocol-blacklist-option.patch
Normal file
437
0025-libmultipath-add-protocol-blacklist-option.patch
Normal file
|
|
@ -0,0 +1,437 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
Date: Thu, 28 Jun 2018 13:16:11 -0500
|
||||
Subject: [PATCH] libmultipath: add "protocol" blacklist option.
|
||||
|
||||
Multiple users have requested an easy way to setup blacklists that do
|
||||
things such as blacklisting all non FC and iSCSI devices. Currently
|
||||
there is no easy way to do this, without knowing in advance what the
|
||||
devices are. Looking into the udev property values, I didn't see a
|
||||
consistent set of values that would worked for all the different types
|
||||
of requests like this (which would have allowed us to solve this by
|
||||
extending the "property" blacklist option to allow comparing values,
|
||||
instead of just keywords).
|
||||
|
||||
Instead I've opted to allow multipath to blacklist/whitelist devices
|
||||
by the protocol strings printed by "multipathd: add new protocol path
|
||||
wildcard". This check happens after multipath checks the "device"
|
||||
keyword, and before it checks wwid. This gives users an easily
|
||||
understandible method to set up these types of blacklists, without
|
||||
needing to know the exact arrays being used.
|
||||
|
||||
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
||||
---
|
||||
libmultipath/blacklist.c | 51 ++++++++++++++++++++++++++++++++++++++--------
|
||||
libmultipath/blacklist.h | 3 +++
|
||||
libmultipath/config.c | 15 ++++++++++++++
|
||||
libmultipath/config.h | 2 ++
|
||||
libmultipath/dict.c | 14 +++++++++++--
|
||||
libmultipath/discovery.c | 5 +++--
|
||||
libmultipath/print.c | 31 ++++++++++++++++++++++++++++
|
||||
multipath/multipath.conf.5 | 15 ++++++++++++++
|
||||
8 files changed, 124 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/libmultipath/blacklist.c b/libmultipath/blacklist.c
|
||||
index 19d4697..41dbf01 100644
|
||||
--- a/libmultipath/blacklist.c
|
||||
+++ b/libmultipath/blacklist.c
|
||||
@@ -12,6 +12,8 @@
|
||||
#include "structs.h"
|
||||
#include "config.h"
|
||||
#include "blacklist.h"
|
||||
+#include "structs_vec.h"
|
||||
+#include "print.h"
|
||||
|
||||
int store_ble(vector blist, char * str, int origin)
|
||||
{
|
||||
@@ -213,12 +215,14 @@ setup_default_blist (struct config * conf)
|
||||
condlog(3, "%s: %s %s %s", dev, (M), wwid, (S)); \
|
||||
else if (env) \
|
||||
condlog(3, "%s: %s %s %s", dev, (M), env, (S)); \
|
||||
+ else if (protocol) \
|
||||
+ condlog(3, "%s: %s %s %s", dev, (M), protocol, (S)); \
|
||||
else \
|
||||
condlog(3, "%s: %s %s", dev, (M), (S))
|
||||
|
||||
void
|
||||
log_filter (const char *dev, char *vendor, char *product, char *wwid,
|
||||
- const char *env, int r)
|
||||
+ const char *env, const char *protocol, int r)
|
||||
{
|
||||
/*
|
||||
* Try to sort from most likely to least.
|
||||
@@ -238,6 +242,9 @@ log_filter (const char *dev, char *vendor, char *product, char *wwid,
|
||||
case MATCH_PROPERTY_BLIST:
|
||||
LOG_BLIST("udev property", "blacklisted");
|
||||
break;
|
||||
+ case MATCH_PROTOCOL_BLIST:
|
||||
+ LOG_BLIST("protocol", "blacklisted");
|
||||
+ break;
|
||||
case MATCH_DEVICE_BLIST_EXCEPT:
|
||||
LOG_BLIST("vendor/product", "whitelisted");
|
||||
break;
|
||||
@@ -253,6 +260,9 @@ log_filter (const char *dev, char *vendor, char *product, char *wwid,
|
||||
case MATCH_PROPERTY_BLIST_MISSING:
|
||||
LOG_BLIST("blacklisted,", "udev property missing");
|
||||
break;
|
||||
+ case MATCH_PROTOCOL_BLIST_EXCEPT:
|
||||
+ LOG_BLIST("protocol", "whitelisted");
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,7 +282,7 @@ int
|
||||
filter_device (vector blist, vector elist, char * vendor, char * product)
|
||||
{
|
||||
int r = _filter_device(blist, elist, vendor, product);
|
||||
- log_filter(NULL, vendor, product, NULL, NULL, r);
|
||||
+ log_filter(NULL, vendor, product, NULL, NULL, NULL, r);
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -292,7 +302,7 @@ int
|
||||
filter_devnode (vector blist, vector elist, char * dev)
|
||||
{
|
||||
int r = _filter_devnode(blist, elist, dev);
|
||||
- log_filter(dev, NULL, NULL, NULL, NULL, r);
|
||||
+ log_filter(dev, NULL, NULL, NULL, NULL, NULL, r);
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -312,7 +322,29 @@ int
|
||||
filter_wwid (vector blist, vector elist, char * wwid, char * dev)
|
||||
{
|
||||
int r = _filter_wwid(blist, elist, wwid);
|
||||
- log_filter(dev, NULL, NULL, wwid, NULL, r);
|
||||
+ log_filter(dev, NULL, NULL, wwid, NULL, NULL, r);
|
||||
+ return r;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+_filter_protocol (vector blist, vector elist, const char * protocol_str)
|
||||
+{
|
||||
+ if (_blacklist_exceptions(elist, protocol_str))
|
||||
+ return MATCH_PROTOCOL_BLIST_EXCEPT;
|
||||
+ if (_blacklist(blist, protocol_str))
|
||||
+ return MATCH_PROTOCOL_BLIST;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+filter_protocol(vector blist, vector elist, struct path * pp)
|
||||
+{
|
||||
+ char buf[PROTOCOL_BUF_SIZE];
|
||||
+ int r;
|
||||
+
|
||||
+ snprint_path_protocol(buf, sizeof(buf), pp);
|
||||
+ r = _filter_protocol(blist, elist, buf);
|
||||
+ log_filter(pp->dev, NULL, NULL, NULL, NULL, buf, r);
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -324,7 +356,6 @@ _filter_path (struct config * conf, struct path * pp)
|
||||
r = filter_property(conf, pp->udev);
|
||||
if (r > 0)
|
||||
return r;
|
||||
-
|
||||
r = _filter_devnode(conf->blist_devnode, conf->elist_devnode,pp->dev);
|
||||
if (r > 0)
|
||||
return r;
|
||||
@@ -332,6 +363,9 @@ _filter_path (struct config * conf, struct path * pp)
|
||||
pp->vendor_id, pp->product_id);
|
||||
if (r > 0)
|
||||
return r;
|
||||
+ r = filter_protocol(conf->blist_protocol, conf->elist_protocol, pp);
|
||||
+ if (r > 0)
|
||||
+ return r;
|
||||
r = _filter_wwid(conf->blist_wwid, conf->elist_wwid, pp->wwid);
|
||||
return r;
|
||||
}
|
||||
@@ -340,7 +374,8 @@ int
|
||||
filter_path (struct config * conf, struct path * pp)
|
||||
{
|
||||
int r=_filter_path(conf, pp);
|
||||
- log_filter(pp->dev, pp->vendor_id, pp->product_id, pp->wwid, NULL, r);
|
||||
+ log_filter(pp->dev, pp->vendor_id, pp->product_id, pp->wwid, NULL,
|
||||
+ NULL, r);
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -375,7 +410,7 @@ filter_property(struct config * conf, struct udev_device * udev)
|
||||
|
||||
r = _filter_property(conf, env);
|
||||
if (r) {
|
||||
- log_filter(devname, NULL, NULL, NULL, env, r);
|
||||
+ log_filter(devname, NULL, NULL, NULL, env, NULL, r);
|
||||
return r;
|
||||
}
|
||||
}
|
||||
@@ -385,7 +420,7 @@ filter_property(struct config * conf, struct udev_device * udev)
|
||||
* the environment variable _has_ to match.
|
||||
*/
|
||||
if (VECTOR_SIZE(conf->elist_property)) {
|
||||
- log_filter(devname, NULL, NULL, NULL, NULL,
|
||||
+ log_filter(devname, NULL, NULL, NULL, NULL, NULL,
|
||||
MATCH_PROPERTY_BLIST_MISSING);
|
||||
return MATCH_PROPERTY_BLIST_MISSING;
|
||||
}
|
||||
diff --git a/libmultipath/blacklist.h b/libmultipath/blacklist.h
|
||||
index 443025d..6797ac5 100644
|
||||
--- a/libmultipath/blacklist.h
|
||||
+++ b/libmultipath/blacklist.h
|
||||
@@ -10,10 +10,12 @@
|
||||
#define MATCH_DEVNODE_BLIST 3
|
||||
#define MATCH_PROPERTY_BLIST 4
|
||||
#define MATCH_PROPERTY_BLIST_MISSING 5
|
||||
+#define MATCH_PROTOCOL_BLIST 6
|
||||
#define MATCH_WWID_BLIST_EXCEPT -MATCH_WWID_BLIST
|
||||
#define MATCH_DEVICE_BLIST_EXCEPT -MATCH_DEVICE_BLIST
|
||||
#define MATCH_DEVNODE_BLIST_EXCEPT -MATCH_DEVNODE_BLIST
|
||||
#define MATCH_PROPERTY_BLIST_EXCEPT -MATCH_PROPERTY_BLIST
|
||||
+#define MATCH_PROTOCOL_BLIST_EXCEPT -MATCH_PROTOCOL_BLIST
|
||||
|
||||
struct blentry {
|
||||
char * str;
|
||||
@@ -36,6 +38,7 @@ int filter_wwid (vector, vector, char *, char *);
|
||||
int filter_device (vector, vector, char *, char *);
|
||||
int filter_path (struct config *, struct path *);
|
||||
int filter_property(struct config *, struct udev_device *);
|
||||
+int filter_protocol(vector, vector, struct path *);
|
||||
int store_ble (vector, char *, int);
|
||||
int set_ble_device (vector, char *, char *, int);
|
||||
void free_blacklist (vector);
|
||||
diff --git a/libmultipath/config.c b/libmultipath/config.c
|
||||
index 9bf4fb7..506c869 100644
|
||||
--- a/libmultipath/config.c
|
||||
+++ b/libmultipath/config.c
|
||||
@@ -538,11 +538,13 @@ free_config (struct config * conf)
|
||||
free_blacklist(conf->blist_devnode);
|
||||
free_blacklist(conf->blist_wwid);
|
||||
free_blacklist(conf->blist_property);
|
||||
+ free_blacklist(conf->blist_protocol);
|
||||
free_blacklist_device(conf->blist_device);
|
||||
|
||||
free_blacklist(conf->elist_devnode);
|
||||
free_blacklist(conf->elist_wwid);
|
||||
free_blacklist(conf->elist_property);
|
||||
+ free_blacklist(conf->elist_protocol);
|
||||
free_blacklist_device(conf->elist_device);
|
||||
|
||||
free_mptable(conf->mptable);
|
||||
@@ -709,6 +711,12 @@ load_config (char * file)
|
||||
if (!conf->blist_property)
|
||||
goto out;
|
||||
}
|
||||
+ if (conf->blist_protocol == NULL) {
|
||||
+ conf->blist_protocol = vector_alloc();
|
||||
+
|
||||
+ if (!conf->blist_protocol)
|
||||
+ goto out;
|
||||
+ }
|
||||
|
||||
if (conf->elist_devnode == NULL) {
|
||||
conf->elist_devnode = vector_alloc();
|
||||
@@ -736,6 +744,13 @@ load_config (char * file)
|
||||
if (!conf->elist_property)
|
||||
goto out;
|
||||
}
|
||||
+ if (conf->elist_protocol == NULL) {
|
||||
+ conf->elist_protocol = vector_alloc();
|
||||
+
|
||||
+ if (!conf->elist_protocol)
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
if (setup_default_blist(conf))
|
||||
goto out;
|
||||
|
||||
diff --git a/libmultipath/config.h b/libmultipath/config.h
|
||||
index 21a3bbd..6fa7f19 100644
|
||||
--- a/libmultipath/config.h
|
||||
+++ b/libmultipath/config.h
|
||||
@@ -207,10 +207,12 @@ struct config {
|
||||
vector blist_wwid;
|
||||
vector blist_device;
|
||||
vector blist_property;
|
||||
+ vector blist_protocol;
|
||||
vector elist_devnode;
|
||||
vector elist_wwid;
|
||||
vector elist_device;
|
||||
vector elist_property;
|
||||
+ vector elist_protocol;
|
||||
};
|
||||
|
||||
extern struct udev * udev;
|
||||
diff --git a/libmultipath/dict.c b/libmultipath/dict.c
|
||||
index 31897cd..810ffaa 100644
|
||||
--- a/libmultipath/dict.c
|
||||
+++ b/libmultipath/dict.c
|
||||
@@ -1179,9 +1179,12 @@ blacklist_handler(struct config *conf, vector strvec)
|
||||
conf->blist_device = vector_alloc();
|
||||
if (!conf->blist_property)
|
||||
conf->blist_property = vector_alloc();
|
||||
+ if (!conf->blist_protocol)
|
||||
+ conf->blist_protocol = vector_alloc();
|
||||
|
||||
if (!conf->blist_devnode || !conf->blist_wwid ||
|
||||
- !conf->blist_device || !conf->blist_property)
|
||||
+ !conf->blist_device || !conf->blist_property ||
|
||||
+ !conf->blist_protocol)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
@@ -1198,9 +1201,12 @@ blacklist_exceptions_handler(struct config *conf, vector strvec)
|
||||
conf->elist_device = vector_alloc();
|
||||
if (!conf->elist_property)
|
||||
conf->elist_property = vector_alloc();
|
||||
+ if (!conf->elist_protocol)
|
||||
+ conf->elist_protocol = vector_alloc();
|
||||
|
||||
if (!conf->elist_devnode || !conf->elist_wwid ||
|
||||
- !conf->elist_device || !conf->elist_property)
|
||||
+ !conf->elist_device || !conf->elist_property ||
|
||||
+ !conf->elist_protocol)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
@@ -1244,6 +1250,8 @@ declare_ble_handler(blist_wwid)
|
||||
declare_ble_handler(elist_wwid)
|
||||
declare_ble_handler(blist_property)
|
||||
declare_ble_handler(elist_property)
|
||||
+declare_ble_handler(blist_protocol)
|
||||
+declare_ble_handler(elist_protocol)
|
||||
|
||||
static int
|
||||
snprint_def_uxsock_timeout(struct config *conf, char * buff, int len, void * data)
|
||||
@@ -1504,6 +1512,7 @@ init_keywords(vector keywords)
|
||||
install_keyword_multi("devnode", &ble_blist_devnode_handler, &snprint_ble_simple);
|
||||
install_keyword_multi("wwid", &ble_blist_wwid_handler, &snprint_ble_simple);
|
||||
install_keyword_multi("property", &ble_blist_property_handler, &snprint_ble_simple);
|
||||
+ install_keyword_multi("protocol", &ble_blist_protocol_handler, &snprint_ble_simple);
|
||||
install_keyword_multi("device", &ble_device_handler, NULL);
|
||||
install_sublevel();
|
||||
install_keyword("vendor", &ble_blist_device_vendor_handler, &snprint_bled_vendor);
|
||||
@@ -1513,6 +1522,7 @@ init_keywords(vector keywords)
|
||||
install_keyword_multi("devnode", &ble_elist_devnode_handler, &snprint_ble_simple);
|
||||
install_keyword_multi("wwid", &ble_elist_wwid_handler, &snprint_ble_simple);
|
||||
install_keyword_multi("property", &ble_elist_property_handler, &snprint_ble_simple);
|
||||
+ install_keyword_multi("protocol", &ble_elist_protocol_handler, &snprint_ble_simple);
|
||||
install_keyword_multi("device", &ble_except_device_handler, NULL);
|
||||
install_sublevel();
|
||||
install_keyword("vendor", &ble_elist_device_vendor_handler, &snprint_bled_vendor);
|
||||
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
|
||||
index f118800..e01ecdc 100644
|
||||
--- a/libmultipath/discovery.c
|
||||
+++ b/libmultipath/discovery.c
|
||||
@@ -1929,9 +1929,10 @@ int pathinfo(struct path *pp, struct config *conf, int mask)
|
||||
|
||||
if (mask & DI_BLACKLIST && mask & DI_SYSFS) {
|
||||
if (filter_device(conf->blist_device, conf->elist_device,
|
||||
- pp->vendor_id, pp->product_id) > 0) {
|
||||
+ pp->vendor_id, pp->product_id) > 0 ||
|
||||
+ filter_protocol(conf->blist_protocol, conf->elist_protocol,
|
||||
+ pp) > 0)
|
||||
return PATHINFO_SKIPPED;
|
||||
- }
|
||||
}
|
||||
|
||||
path_state = path_offline(pp);
|
||||
diff --git a/libmultipath/print.c b/libmultipath/print.c
|
||||
index 00739bc..ce3682d 100644
|
||||
--- a/libmultipath/print.c
|
||||
+++ b/libmultipath/print.c
|
||||
@@ -1518,6 +1518,19 @@ int snprint_blacklist_report(struct config *conf, char *buff, int len)
|
||||
|
||||
if ((len - fwd - threshold) <= 0)
|
||||
return len;
|
||||
+ fwd += snprintf(buff + fwd, len - fwd, "protocol rules:\n"
|
||||
+ "- blacklist:\n");
|
||||
+ if (!snprint_blacklist_group(buff, len, &fwd, &conf->blist_protocol))
|
||||
+ return len;
|
||||
+
|
||||
+ if ((len - fwd - threshold) <= 0)
|
||||
+ return len;
|
||||
+ fwd += snprintf(buff + fwd, len - fwd, "- exceptions:\n");
|
||||
+ if (snprint_blacklist_group(buff, len, &fwd, &conf->elist_protocol) == 0)
|
||||
+ return len;
|
||||
+
|
||||
+ if ((len - fwd - threshold) <= 0)
|
||||
+ return len;
|
||||
fwd += snprintf(buff + fwd, len - fwd, "wwid rules:\n"
|
||||
"- blacklist:\n");
|
||||
if (snprint_blacklist_group(buff, len, &fwd, &conf->blist_wwid) == 0)
|
||||
@@ -1591,6 +1604,15 @@ int snprint_blacklist(struct config *conf, char *buff, int len)
|
||||
if (fwd >= len)
|
||||
return len;
|
||||
}
|
||||
+ vector_foreach_slot (conf->blist_protocol, ble, i) {
|
||||
+ kw = find_keyword(conf->keywords, rootkw->sub, "protocol");
|
||||
+ if (!kw)
|
||||
+ return 0;
|
||||
+ fwd += snprint_keyword(buff + fwd, len - fwd, "\t%k %v\n",
|
||||
+ kw, ble);
|
||||
+ if (fwd >= len)
|
||||
+ return len;
|
||||
+ }
|
||||
rootkw = find_keyword(conf->keywords, rootkw->sub, "device");
|
||||
if (!rootkw)
|
||||
return 0;
|
||||
@@ -1667,6 +1689,15 @@ int snprint_blacklist_except(struct config *conf, char *buff, int len)
|
||||
if (fwd >= len)
|
||||
return len;
|
||||
}
|
||||
+ vector_foreach_slot (conf->elist_protocol, ele, i) {
|
||||
+ kw = find_keyword(conf->keywords, rootkw->sub, "protocol");
|
||||
+ if (!kw)
|
||||
+ return 0;
|
||||
+ fwd += snprint_keyword(buff + fwd, len - fwd, "\t%k %v\n",
|
||||
+ kw, ele);
|
||||
+ if (fwd >= len)
|
||||
+ return len;
|
||||
+ }
|
||||
rootkw = find_keyword(conf->keywords, rootkw->sub, "device");
|
||||
if (!rootkw)
|
||||
return 0;
|
||||
diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5
|
||||
index 2201d7f..2be5d2a 100644
|
||||
--- a/multipath/multipath.conf.5
|
||||
+++ b/multipath/multipath.conf.5
|
||||
@@ -1084,6 +1084,10 @@ The \fIWorld Wide Identification\fR of a device.
|
||||
.B property
|
||||
Regular expression of the udev property to be excluded.
|
||||
.TP
|
||||
+.B protocol
|
||||
+Regular expression of the protocol to be excluded. See below for a
|
||||
+list of recognized protocols
|
||||
+.TP
|
||||
.B device
|
||||
Subsection for the device description. This subsection recognizes the
|
||||
.B vendor
|
||||
@@ -1091,6 +1095,13 @@ and
|
||||
.B product
|
||||
keywords. For a full description of these keywords please see the
|
||||
\fIdevices\fR section description.
|
||||
+.LP
|
||||
+The protocol strings that multipath recognizes are \fIscsi:fcp\fR,
|
||||
+\fIscsi:spi\fR, \fIscsi:ssa\fR, \fIscsi:sbp\fR, \fIscsi:srp\fR,
|
||||
+\fIscsi:iscsi\fR, \fIscsi:sas\fR, \fIscsi:adt\fR, \fIscsi:ata\fR,
|
||||
+\fIscsi:unspec\fR, \fIccw\fR, \fIcciss\fR, \fInvme\fR, and \fIundef\fR.
|
||||
+The protocol that a path is using can be viewed by running
|
||||
+\fBmultipathd show paths format "%d %P"\fR
|
||||
.
|
||||
.
|
||||
.\" ----------------------------------------------------------------------------
|
||||
@@ -1115,6 +1126,10 @@ The \fIWorld Wide Identification\fR of a device.
|
||||
.B property
|
||||
Regular expression of the udev property to be whitelisted.
|
||||
.TP
|
||||
+.B protocol
|
||||
+Regular expression of the protocol to be whitelisted. See the
|
||||
+\fBblacklist section\fR for a list of recognized protocols
|
||||
+.TP
|
||||
.B device
|
||||
Subsection for the device description. This subsection recognizes the
|
||||
.B vendor
|
||||
--
|
||||
2.7.4
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
Summary: Tools to manage multipath devices using device-mapper
|
||||
Name: device-mapper-multipath
|
||||
Version: 0.7.4
|
||||
Release: 2.git07e7bd5%{?dist}
|
||||
Release: 3.git07e7bd5%{?dist}
|
||||
License: GPL+
|
||||
Group: System Environment/Base
|
||||
URL: http://christophe.varoqui.free.fr/
|
||||
|
|
@ -33,6 +33,9 @@ Patch0019: 0019-RH-add-mpathconf.patch
|
|||
Patch0020: 0020-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch
|
||||
Patch0021: 0021-RH-trigger-change-uevent-on-new-device-creation.patch
|
||||
Patch0022: 0022-RH-warn-on-invalid-regex-instead-of-failing.patch
|
||||
Patch0023: 0023-libmutipath-remove-unused-IDE-bus-type.patch
|
||||
Patch0024: 0024-multipathd-add-new-protocol-path-wildcard.patch
|
||||
Patch0025: 0025-libmultipath-add-protocol-blacklist-option.patch
|
||||
|
||||
# runtime
|
||||
Requires: %{name}-libs = %{version}-%{release}
|
||||
|
|
@ -133,6 +136,9 @@ device-mapper-multipath's libdmmp C API library
|
|||
%patch0020 -p1
|
||||
%patch0021 -p1
|
||||
%patch0022 -p1
|
||||
%patch0023 -p1
|
||||
%patch0024 -p1
|
||||
%patch0025 -p1
|
||||
cp %{SOURCE1} .
|
||||
|
||||
%build
|
||||
|
|
@ -256,6 +262,14 @@ fi
|
|||
%{_pkgconfdir}/libdmmp.pc
|
||||
|
||||
%changelog
|
||||
* Wed Jul 18 2018 Benjamin Marzinski <bmarzins@redhat.com> 0.7.4-3.git07e7bd5
|
||||
- Add 0023-libmutipath-remove-unused-IDE-bus-type.patch
|
||||
- Add 0024-multipathd-add-new-protocol-path-wildcard.patch
|
||||
* multipathd show paths format now accepts %P for the path protocol/transport
|
||||
- Add 0025-libmultipath-add-protocol-blacklist-option.patch
|
||||
* You can now use the "protocol" blacklist section parameter to blacklist
|
||||
by protocol/transport
|
||||
|
||||
* Tue Mar 06 2018 Björn Esser <besser82@fedoraproject.org> - 0.7.4-2.git07e7bd5
|
||||
- Rebuilt for libjson-c.so.4 (json-c v0.13.1)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue