device-mapper-multipath/0098-UPBZ-1067171-mutipath-i.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

333 lines
9.8 KiB
Diff

---
libmultipath/config.h | 15 ++++++++-
libmultipath/configure.c | 2 -
libmultipath/discovery.c | 5 +--
multipath/main.c | 75 +++++++++++++++++++++++++----------------------
multipath/multipath.8 | 5 ++-
5 files changed, 61 insertions(+), 41 deletions(-)
Index: multipath-tools-130222/libmultipath/config.h
===================================================================
--- multipath-tools-130222.orig/libmultipath/config.h
+++ multipath-tools-130222/libmultipath/config.h
@@ -23,6 +23,17 @@ enum devtypes {
DEV_DEVMAP
};
+enum mpath_cmds {
+ CMD_CREATE,
+ CMD_DRY_RUN,
+ CMD_LIST_SHORT,
+ CMD_LIST_LONG,
+ CMD_VALID_PATH,
+ CMD_REMOVE_WWID,
+ CMD_RESET_WWIDS,
+ CMD_ADD_WWID,
+};
+
struct hwentry {
char * vendor;
char * product;
@@ -79,8 +90,7 @@ struct mpentry {
struct config {
int verbosity;
- int dry_run;
- int list;
+ enum mpath_cmds cmd;
int pgpolicy_flag;
int pgpolicy;
enum devtypes dev_type;
@@ -98,6 +108,7 @@ struct config {
int max_fds;
int force_reload;
int queue_without_daemon;
+ int ignore_wwids;
int checker_timeout;
int daemon;
int flush_on_last_del;
Index: multipath-tools-130222/multipath/main.c
===================================================================
--- multipath-tools-130222.orig/multipath/main.c
+++ multipath-tools-130222/multipath/main.c
@@ -85,7 +85,7 @@ usage (char * progname)
{
fprintf (stderr, VERSION_STRING);
fprintf (stderr, "Usage:\n");
- fprintf (stderr, " %s [-a|-A|-c|-w|-W] [-d] [-T tm:val] [-r] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname);
+ fprintf (stderr, " %s [-a|-A|-c|-w|-W] [-d] [-T tm:val] [-r] [-i] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname);
fprintf (stderr, " %s -l|-ll|-f [-v lvl] [-b fil] [dev]\n", progname);
fprintf (stderr, " %s -F [-v lvl]\n", progname);
fprintf (stderr, " %s -t\n", progname);
@@ -109,6 +109,7 @@ usage (char * progname)
" -d dry run, do not create or update devmaps\n" \
" -t dump internal hardware table\n" \
" -r force devmap reload\n" \
+ " -i ignore wwids file\n" \
" -B treat the bindings file as read only\n" \
" -p policy failover|multibus|group_by_serial|group_by_prio\n" \
" -b fil bindings file location\n" \
@@ -209,18 +210,19 @@ get_dm_mpvec (vector curmp, vector pathv
* If not in "fast list mode", we need to fetch information
* about them
*/
- if (conf->list != 1)
+ if (conf->cmd != CMD_LIST_SHORT)
update_paths(mpp);
- if (conf->list > 1)
+ if (conf->cmd == CMD_LIST_LONG)
mpp->bestpg = select_path_group(mpp);
disassemble_status(status, mpp);
- if (conf->list)
+ if (conf->cmd == CMD_LIST_SHORT ||
+ conf->cmd == CMD_LIST_LONG)
print_multipath_topology(mpp, conf->verbosity);
- if (!conf->dry_run)
+ if (conf->cmd == CMD_CREATE)
reinstate_paths(mpp);
}
return 0;
@@ -262,10 +264,11 @@ configure (void)
/*
* if we have a blacklisted device parameter, exit early
*/
- if (dev && conf->dev_type == DEV_DEVNODE && conf->dry_run != 3 &&
+ if (dev && conf->dev_type == DEV_DEVNODE &&
+ conf->cmd != CMD_REMOVE_WWID &&
(filter_devnode(conf->blist_devnode,
conf->elist_devnode, dev) > 0)) {
- if (conf->dry_run == 2)
+ if (conf->cmd == CMD_VALID_PATH)
printf("%s is not a valid multipath device path\n",
conf->dev);
goto out;
@@ -278,13 +281,13 @@ configure (void)
int failed = get_refwwid(conf->dev, conf->dev_type, pathvec,
&refwwid);
if (!refwwid) {
- if (failed == 2 && conf->dry_run == 2)
+ if (failed == 2 && conf->cmd == CMD_VALID_PATH)
printf("%s is not a valid multipath device path\n", conf->dev);
else
condlog(3, "scope is nul");
goto out;
}
- if (conf->dry_run == 3) {
+ if (conf->cmd == CMD_REMOVE_WWID) {
r = remove_wwid(refwwid);
if (r == 0)
printf("wwid '%s' removed\n", refwwid);
@@ -295,7 +298,7 @@ configure (void)
}
goto out;
}
- if (conf->dry_run == 5) {
+ if (conf->cmd == CMD_ADD_WWID) {
r = remember_wwid(refwwid);
if (r == 0)
printf("wwid '%s' added\n", refwwid);
@@ -305,13 +308,13 @@ configure (void)
goto out;
}
condlog(3, "scope limited to %s", refwwid);
- if (conf->dry_run == 2) {
- if (check_wwids_file(refwwid, 0) == 0){
- printf("%s is a valid multipath device path\n", conf->dev);
+ if (conf->cmd == CMD_VALID_PATH) {
+ if (conf->ignore_wwids ||
+ check_wwids_file(refwwid, 0) == 0)
r = 0;
- }
- else
- printf("%s is not a valid multipath device path\n", conf->dev);
+
+ printf("%s %s a valid multipath device path\n",
+ conf->dev, r == 0 ? "is" : "is not");
goto out;
}
}
@@ -319,13 +322,13 @@ configure (void)
/*
* get a path list
*/
- if (conf->dev && !conf->list)
+ if (conf->dev)
di_flag = DI_WWID;
- if (conf->list > 1)
+ if (conf->cmd == CMD_LIST_LONG)
/* extended path info '-ll' */
di_flag |= DI_SYSFS | DI_CHECKER;
- else if (conf->list)
+ else if (conf->cmd == CMD_LIST_SHORT)
/* minimum path info '-l' */
di_flag |= DI_SYSFS;
else
@@ -345,7 +348,7 @@ configure (void)
filter_pathvec(pathvec, refwwid);
- if (conf->list) {
+ if (conf->cmd != CMD_CREATE && conf->cmd != CMD_DRY_RUN) {
r = 0;
goto out;
}
@@ -440,7 +443,7 @@ main (int argc, char *argv[])
int r = 1;
long int timestamp = -1;
int valid = -1;
- while ((arg = getopt(argc, argv, ":aAdchl::FfM:v:p:b:BrtT:qwW")) != EOF ) {
+ while ((arg = getopt(argc, argv, ":aAdchl::FfM:v:p:b:BritT:qwW")) != EOF ) {
switch(arg) {
case 'T':
if (optarg[0] == ':')
@@ -476,7 +479,7 @@ main (int argc, char *argv[])
if (dm_prereq())
exit(1);
- while ((arg = getopt(argc, argv, ":aAdchl::FfM:v:p:b:BrtT:qwW")) != EOF ) {
+ while ((arg = getopt(argc, argv, ":aAdchl::FfM:v:p:b:BritT:qwW")) != EOF ) {
switch(arg) {
case 1: printf("optarg : %s\n",optarg);
break;
@@ -499,11 +502,11 @@ main (int argc, char *argv[])
conf->allow_queueing = 1;
break;
case 'c':
- conf->dry_run = 2;
+ conf->cmd = CMD_VALID_PATH;
break;
case 'd':
- if (!conf->dry_run)
- conf->dry_run = 1;
+ if (conf->cmd == CMD_CREATE)
+ conf->cmd = CMD_DRY_RUN;
break;
case 'f':
conf->remove = FLUSH_ONE;
@@ -512,11 +515,10 @@ main (int argc, char *argv[])
conf->remove = FLUSH_ALL;
break;
case 'l':
- conf->list = 1;
- conf->dry_run = 1;
-
if (optarg && !strncmp(optarg, "l", 1))
- conf->list++;
+ conf->cmd = CMD_LIST_LONG;
+ else
+ conf->cmd = CMD_LIST_SHORT;
break;
case 'M':
@@ -535,6 +537,9 @@ main (int argc, char *argv[])
case 'r':
conf->force_reload = 1;
break;
+ case 'i':
+ conf->ignore_wwids = 1;
+ break;
case 't':
r = dump_config();
goto out;
@@ -548,13 +553,13 @@ main (int argc, char *argv[])
usage(argv[0]);
exit(0);
case 'w':
- conf->dry_run = 3;
+ conf->cmd = CMD_REMOVE_WWID;
break;
case 'W':
- conf->dry_run = 4;
+ conf->cmd = CMD_RESET_WWIDS;
break;
case 'a':
- conf->dry_run = 5;
+ conf->cmd = CMD_ADD_WWID;
break;
case ':':
fprintf(stderr, "Missing option argument\n");
@@ -600,16 +605,16 @@ main (int argc, char *argv[])
}
dm_init();
- if (conf->dry_run == 2 &&
+ if (conf->cmd == CMD_VALID_PATH &&
(!conf->dev || conf->dev_type == DEV_DEVMAP)) {
condlog(0, "the -c option requires a path to check");
goto out;
}
- if (conf->dry_run == 3 && !conf->dev) {
+ if (conf->cmd == CMD_REMOVE_WWID && !conf->dev) {
condlog(0, "the -w option requires a device");
goto out;
}
- if (conf->dry_run == 4) {
+ if (conf->cmd == CMD_RESET_WWIDS) {
struct multipath * mpp;
int i;
vector curmp;
Index: multipath-tools-130222/multipath/multipath.8
===================================================================
--- multipath-tools-130222.orig/multipath/multipath.8
+++ multipath-tools-130222/multipath/multipath.8
@@ -8,7 +8,7 @@ multipath \- Device mapper target autoco
.RB [\| \-b\ \c
.IR bindings_file \|]
.RB [\| \-d \|]
-.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-q | \|-r | \-a | \-A | \-w | \-W \|]
+.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-q | \|-r | \-r | \-a | \-A | \-w | \-W \|]
.RB [\| \-p\ \c
.BR failover | multibus | group_by_serial | group_by_prio | group_by_node_name \|]
.RB [\| device \|]
@@ -55,6 +55,9 @@ print internal hardware table to stdout
.B \-r
force devmap reload
.TP
+.B \-i
+ignore wwids file when processing devices
+.TP
.B \-B
treat the bindings file as read only
.TP
Index: multipath-tools-130222/libmultipath/configure.c
===================================================================
--- multipath-tools-130222.orig/libmultipath/configure.c
+++ multipath-tools-130222/libmultipath/configure.c
@@ -580,7 +580,7 @@ domap (struct multipath * mpp, char * pa
/*
* last chance to quit before touching the devmaps
*/
- if (conf->dry_run && mpp->action != ACT_NOTHING) {
+ if (conf->cmd == CMD_DRY_RUN && mpp->action != ACT_NOTHING) {
print_multipath_topology(mpp, conf->verbosity);
return DOMAP_DRY;
}
Index: multipath-tools-130222/libmultipath/discovery.c
===================================================================
--- multipath-tools-130222.orig/libmultipath/discovery.c
+++ multipath-tools-130222/libmultipath/discovery.c
@@ -54,7 +54,8 @@ store_pathinfo (vector pathvec, vector h
}
pp->udev = udev_device_ref(udevice);
err = pathinfo(pp, hwtable,
- (conf->dry_run == 3)? flag : (flag | DI_BLACKLIST));
+ (conf->cmd == CMD_REMOVE_WWID)? flag :
+ (flag | DI_BLACKLIST));
if (err)
goto out;
@@ -1101,7 +1102,7 @@ get_uid (struct path * pp)
memset(pp->wwid, 0, WWID_SIZE);
value = udev_device_get_property_value(pp->udev, pp->uid_attribute);
- if ((!value || strlen(value) == 0) && conf->dry_run == 2)
+ if ((!value || strlen(value) == 0) && conf->cmd == CMD_VALID_PATH)
value = getenv(pp->uid_attribute);
if (value && strlen(value)) {
size_t len = WWID_SIZE;