device-mapper-multipath/0099-RH-add-all-devs.patch
Benjamin Marzinski efd38c93e9 device-mapper-multipath-0.4.9-68
Modify multipath.conf
  * remove getuid_callout example
Re-add 0050-RH-listing-speedup.patch
Add 0081-RHBZ-1066264-check-prefix-on-rename.patch
  * make multipath check the prefix on kpartx partitions during rename, and
    copy the existing behaviour
Add 0082-UPBZ-1109995-no-sync-turs-on-pthread_cancel.patch
  * If async tur checker fails on threads, don't retry with the sync version
Add 0083-RHBZ-1080055-orphan-paths-on-reload.patch
  * Fix case where pathlist wasn't getting updated properly
Add 0084-RHBZ-1110000-multipath-man.patch
  * fix errors in multipath man page
Add 0085-UPBZ-1110006-datacore-config.patch
  * Add support for DataCore Virtual Disk
Add 0086-RHBZ-1110007-orphan-path-on-failed-add.patch
  * If multipathd fails to add path correctly, it now fully orphans the path
Add 0087-RHBZ-1110013-config-error-checking.patch
  * Improve multipath.conf error checking.
Add 0088-RHBZ-1069811-configurable-prio-timeout.patch
  * checker_timeout now adjusts the timeouts of the prioritizers as well.
Add 0089-RHBZ-1110016-add-noasync-option.patch
  * Add a new defaults option, "force_sync", that disables the async mode
    of the path checkers. This is for cases where to many parallel checkers
    hog the cpu
Add 0090-UPBZ-1080038-reorder-paths-for-round-robin.patch
  * make multipathd order paths for better throughput in round-robin mode
Add 0091-RHBZ-1069584-fix-empty-values-fast-io-fail-and-dev-loss.patch
  * check for null pointers in configuration reading code.
Add 0092-UPBZ-1104605-reload-on-rename.patch
  * Reload table on rename if necessary
Add 0093-UPBZ-1086825-user-friendly-name-remap.patch
  * Keep existing user_friend_name if possible
Add 0094-RHBZ-1086825-cleanup-remap.patch
  * Cleanup issues with upstream patch
Add 0095-RHBZ-1127944-xtremIO-config.patch
  * Add support for EMC ExtremIO devices
Add 0096-RHBZ-979474-new-wildcards.patch
  * Add N, n, R, and r path wildcards to print World Wide ids
Add 0097-RH-fix-coverity-errors.patch
  * Fix a number of unterminated strings and memory leaks on failure
    paths.
Add 0098-UPBZ-1067171-mutipath-i.patch
  * Add -i option to ignore wwids file when checking for valid paths
Add 0099-RH-add-all-devs.patch
  * Add new devices config option all_devs. This makes the configuration
    overwrite the specified values in all builtin configs
Add 0100-RHBZ-1067171-multipath-i-update.patch
  * make -i work correctly with find_multipaths
Add 0101-RH-adapter-name-wildcard.patch
  * Add 'a' path wildcard to print adapter name
2014-09-16 18:22:40 -05:00

171 lines
4.5 KiB
Diff

---
libmultipath/config.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++++-
libmultipath/config.h | 1
libmultipath/dict.c | 38 +++++++++++++++++++++++++++++
3 files changed, 102 insertions(+), 1 deletion(-)
Index: multipath-tools-130222/libmultipath/config.c
===================================================================
--- multipath-tools-130222.orig/libmultipath/config.c
+++ multipath-tools-130222/libmultipath/config.c
@@ -113,6 +113,8 @@ find_hwe (vector hwtable, char * vendor,
* continuing to the generic entries
*/
vector_foreach_slot_backwards (hwtable, tmp, i) {
+ if (tmp->all_devs == 1)
+ continue;
if (hwe_regmatch(tmp, &hwe))
continue;
ret = tmp;
@@ -348,6 +350,62 @@ merge_hwe (struct hwentry * dst, struct
return 0;
}
+#define overwrite_str(s) \
+do { \
+ if (src->s) { \
+ if (dst->s) \
+ FREE(dst->s); \
+ if (!(dst->s = set_param_str(src->s))) \
+ return 1; \
+ } \
+} while(0)
+
+#define overwrite_num(s) \
+do { \
+ if (src->s) \
+ dst->s = src->s; \
+} while(0)
+
+static int
+overwrite_hwe (struct hwentry * dst, struct hwentry * src)
+{
+ overwrite_str(vendor);
+ overwrite_str(product);
+ overwrite_str(revision);
+ overwrite_str(uid_attribute);
+ overwrite_str(features);
+ overwrite_str(hwhandler);
+ overwrite_str(selector);
+ overwrite_str(checker_name);
+ overwrite_str(prio_name);
+ overwrite_str(prio_args);
+ overwrite_str(alias_prefix);
+ overwrite_str(bl_product);
+ overwrite_num(pgpolicy);
+ overwrite_num(pgfailback);
+ overwrite_num(rr_weight);
+ overwrite_num(no_path_retry);
+ overwrite_num(minio);
+ overwrite_num(minio_rq);
+ overwrite_num(pg_timeout);
+ overwrite_num(flush_on_last_del);
+ overwrite_num(fast_io_fail);
+ overwrite_num(dev_loss);
+ overwrite_num(user_friendly_names);
+ overwrite_num(retain_hwhandler);
+ overwrite_num(detect_prio);
+
+ /*
+ * Make sure features is consistent with
+ * no_path_retry
+ */
+ if (dst->no_path_retry == NO_PATH_RETRY_FAIL)
+ remove_feature(&dst->features, "queue_if_no_path");
+ else if (dst->no_path_retry != NO_PATH_RETRY_UNDEF)
+ add_feature(&dst->features, "queue_if_no_path");
+ return 0;
+}
+
int
store_hwe (vector hwtable, struct hwentry * dhwe)
{
@@ -431,7 +489,11 @@ restart:
break;
j = n;
vector_foreach_slot_after(hw, hwe2, j) {
- if (conf->hw_strmatch) {
+ if (hwe2->all_devs == 1) {
+ overwrite_hwe(hwe1, hwe2);
+ continue;
+ }
+ else if (conf->hw_strmatch) {
if (hwe_strmatch(hwe2, hwe1))
continue;
}
Index: multipath-tools-130222/libmultipath/config.h
===================================================================
--- multipath-tools-130222.orig/libmultipath/config.h
+++ multipath-tools-130222/libmultipath/config.h
@@ -47,6 +47,7 @@ struct hwentry {
char * prio_args;
char * alias_prefix;
+ int all_devs;
int pgpolicy;
int pgfailback;
int rr_weight;
Index: multipath-tools-130222/libmultipath/dict.c
===================================================================
--- multipath-tools-130222.orig/libmultipath/dict.c
+++ multipath-tools-130222/libmultipath/dict.c
@@ -918,6 +918,32 @@ device_handler(vector strvec)
}
static int
+all_devs_handler(vector strvec)
+{
+ char * buff;
+ struct hwentry *hwe = VECTOR_LAST_SLOT(conf->hwtable);
+
+ if (!hwe)
+ return 1;
+
+ buff = set_value(strvec);
+ if (!buff)
+ return 1;
+
+ if ((strlen(buff) == 2 && !strcmp(buff, "no")) ||
+ (strlen(buff) == 1 && !strcmp(buff, "0")))
+ hwe->all_devs = 0;
+ else if ((strlen(buff) == 3 && !strcmp(buff, "yes")) ||
+ (strlen(buff) == 1 && !strcmp(buff, "1")))
+ hwe->all_devs = 1;
+ else
+ hwe->all_devs = 0;
+
+ FREE(buff);
+ return 0;
+}
+
+static int
vendor_handler(vector strvec)
{
struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
@@ -2182,6 +2208,17 @@ snprint_hw_dev_loss(char * buff, int len
}
static int
+snprint_hw_all_devs (char *buff, int len, void *data)
+{
+ struct hwentry * hwe = (struct hwentry *)data;
+
+ if (!hwe->all_devs)
+ return 0;
+
+ return snprintf(buff, len, "yes");
+}
+
+static int
snprint_hw_vendor (char * buff, int len, void * data)
{
struct hwentry * hwe = (struct hwentry *)data;
@@ -2968,6 +3005,7 @@ init_keywords(void)
install_keyword_root("devices", &devices_handler);
install_keyword_multi("device", &device_handler, NULL);
install_sublevel();
+ install_keyword("all_devs", &all_devs_handler, &snprint_hw_all_devs);
install_keyword("vendor", &vendor_handler, &snprint_hw_vendor);
install_keyword("product", &product_handler, &snprint_hw_product);
install_keyword("revision", &revision_handler, &snprint_hw_revision);