Blame SOURCES/0079-RHBZ-1070581-add-wwid-option.patch

e41771
---
e41771
 multipath/main.c      |   19 ++++++++++++++++---
e41771
 multipath/multipath.8 |    5 ++++-
e41771
 2 files changed, 20 insertions(+), 4 deletions(-)
e41771
e41771
Index: multipath-tools-130222/multipath/main.c
e41771
===================================================================
e41771
--- multipath-tools-130222.orig/multipath/main.c
e41771
+++ multipath-tools-130222/multipath/main.c
e41771
@@ -85,7 +85,7 @@ usage (char * progname)
e41771
 {
e41771
 	fprintf (stderr, VERSION_STRING);
e41771
 	fprintf (stderr, "Usage:\n");
e41771
-	fprintf (stderr, "  %s [-c|-w|-W] [-d] [-T tm:val] [-r] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname);
e41771
+	fprintf (stderr, "  %s [-a|-c|-w|-W] [-d] [-T tm:val] [-r] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname);
e41771
 	fprintf (stderr, "  %s -l|-ll|-f [-v lvl] [-b fil] [dev]\n", progname);
e41771
 	fprintf (stderr, "  %s -F [-v lvl]\n", progname);
e41771
 	fprintf (stderr, "  %s -t\n", progname);
e41771
@@ -98,6 +98,7 @@ usage (char * progname)
e41771
 		"  -ll     show multipath topology (maximum info)\n" \
e41771
 		"  -f      flush a multipath device map\n" \
e41771
 		"  -F      flush all multipath device maps\n" \
e41771
+		"  -a      add a device wwid to the wwids file\n" \
e41771
 		"  -c      check if a device should be a path in a multipath device\n" \
e41771
 		"  -T tm:val\n" \
e41771
 		"          check if tm matches the multipathd timestamp. If so val is\n" \
e41771
@@ -292,6 +293,15 @@ configure (void)
e41771
 			}
e41771
 			goto out;
e41771
 		}
e41771
+		if (conf->dry_run == 5) {
e41771
+			r = remember_wwid(refwwid);
e41771
+			if (r == 0)
e41771
+				printf("wwid '%s' added\n", refwwid);
e41771
+			else
e41771
+				printf("failed adding '%s' to wwids file\n",
e41771
+					refwwid);
e41771
+			goto out;
e41771
+		}
e41771
 		condlog(3, "scope limited to %s", refwwid);
e41771
 		if (conf->dry_run == 2) {
e41771
 			if (check_wwids_file(refwwid, 0) == 0){
e41771
@@ -428,7 +438,7 @@ main (int argc, char *argv[])
e41771
 	int r = 1;
e41771
 	long int timestamp = -1;
e41771
 	int valid = -1;
e41771
-	while ((arg = getopt(argc, argv, ":dchl::FfM:v:p:b:BrtT:qwW")) != EOF ) {
e41771
+	while ((arg = getopt(argc, argv, ":adchl::FfM:v:p:b:BrtT:qwW")) != EOF ) {
e41771
 		switch(arg) {
e41771
 		case 'T':
e41771
 			if (optarg[0] == ':')
e41771
@@ -464,7 +474,7 @@ main (int argc, char *argv[])
e41771
 	if (dm_prereq())
e41771
 		exit(1);
e41771
 
e41771
-	while ((arg = getopt(argc, argv, ":dchl::FfM:v:p:b:BrtT:qwW")) != EOF ) {
e41771
+	while ((arg = getopt(argc, argv, ":adchl::FfM:v:p:b:BrtT:qwW")) != EOF ) {
e41771
 		switch(arg) {
e41771
 		case 1: printf("optarg : %s\n",optarg);
e41771
 			break;
e41771
@@ -537,6 +547,9 @@ main (int argc, char *argv[])
e41771
 		case 'W':
e41771
 			conf->dry_run = 4;
e41771
 			break;
e41771
+		case 'a':
e41771
+			conf->dry_run = 5;
e41771
+			break;
e41771
 		case ':':
e41771
 			fprintf(stderr, "Missing option argument\n");
e41771
 			usage(argv[0]);
e41771
Index: multipath-tools-130222/multipath/multipath.8
e41771
===================================================================
e41771
--- multipath-tools-130222.orig/multipath/multipath.8
e41771
+++ multipath-tools-130222/multipath/multipath.8
e41771
@@ -8,7 +8,7 @@ multipath \- Device mapper target autoco
e41771
 .RB [\| \-b\ \c
e41771
 .IR bindings_file \|]
e41771
 .RB [\| \-d \|]
e41771
-.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-q | \|-r | \-w | \-W \|]
e41771
+.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-q | \|-r | \-a | \-w | \-W \|]
e41771
 .RB [\| \-p\ \c
e41771
 .BR failover | multibus | group_by_serial | group_by_prio | group_by_node_name \|]
e41771
 .RB [\| device \|]
e41771
@@ -68,6 +68,9 @@ check if a block device should be a path
e41771
 .B \-q
e41771
 allow device tables with queue_if_no_path when multipathd is not running
e41771
 .TP
e41771
+.B \-a
e41771
+add the wwid for the specified device to the wwids file
e41771
+.TP
e41771
 .B \-w
e41771
 remove the wwid for the specified device from the wwids file
e41771
 .TP