<div dir="ltr">Applied.<div>Thanks.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jul 4, 2014 at 8:20 AM, Hannes Reinecke <span dir="ltr"><<a href="mailto:hare@suse.de" target="_blank">hare@suse.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When called from udev the multipath program is used to check<br>
if a device should be handled by multipath. Any new device,<br>
however, will not be present in /etc/multipath/wwids, and<br>
the check will always fail.<br>
This patch implements the option '-i' to multipath to skip<br>
checking the wwids file for these scenarios.<br>
<br>
Signed-off-by: Hannes Reinecke <<a href="mailto:hare@suse.de">hare@suse.de</a>><br>
---<br>
 libmultipath/config.h |  1 +<br>
 multipath/main.c      | 18 +++++++++++-------<br>
 multipath/multipath.8 |  5 ++++-<br>
 3 files changed, 16 insertions(+), 8 deletions(-)<br>
<br>
diff --git a/libmultipath/config.h b/libmultipath/config.h<br>
index ac7c58e..ca17f39 100644<br>
--- a/libmultipath/config.h<br>
+++ b/libmultipath/config.h<br>
@@ -106,6 +106,7 @@ struct config {<br>
        int max_fds;<br>
        int force_reload;<br>
        int queue_without_daemon;<br>
+       int ignore_wwids;<br>
        int checker_timeout;<br>
        int daemon;<br>
 #ifdef USE_SYSTEMD<br>
diff --git a/multipath/main.c b/multipath/main.c<br>
index 157475e..fd6262f 100644<br>
--- a/multipath/main.c<br>
+++ b/multipath/main.c<br>
@@ -84,7 +84,7 @@ usage (char * progname)<br>
 {<br>
        fprintf (stderr, VERSION_STRING);<br>
        fprintf (stderr, "Usage:\n");<br>
-       fprintf (stderr, "  %s [-a|-c|-w|-W] [-d] [-r] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname);<br>
+       fprintf (stderr, "  %s [-a|-c|-w|-W] [-d] [-r] [-i] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname);<br>
        fprintf (stderr, "  %s -l|-ll|-f [-v lvl] [-b fil] [dev]\n", progname);<br>
        fprintf (stderr, "  %s -F [-v lvl]\n", progname);<br>
        fprintf (stderr, "  %s -t\n", progname);<br>
@@ -103,6 +103,7 @@ usage (char * progname)<br>
                "  -d      dry run, do not create or update devmaps\n" \<br>
                "  -t      dump internal hardware table\n" \<br>
                "  -r      force devmap reload\n" \<br>
+               "  -i      ignore wwids file\n" \<br>
                "  -B      treat the bindings file as read only\n" \<br>
                "  -p      policy failover|multibus|group_by_serial|group_by_prio\n" \<br>
                "  -b fil  bindings file location\n" \<br>
@@ -307,12 +308,12 @@ configure (void)<br>
                }<br>
                condlog(3, "scope limited to %s", refwwid);<br>
                if (conf->cmd == CMD_VALID_PATH) {<br>
-                       if (check_wwids_file(refwwid, 0) == 0){<br>
-                               printf("%s is a valid multipath device path\n", conf->dev);<br>
+                       if (conf->ignore_wwids ||<br>
+                           check_wwids_file(refwwid, 0) == 0)<br>
                                r = 0;<br>
-                       }<br>
-                       else<br>
-                               printf("%s is not a valid multipath device path\n", conf->dev);<br>
+<br>
+                       printf("%s %s a valid multipath device path\n",<br>
+                              conf->dev, r == 0 ? "is" : "is not");<br>
                        goto out;<br>
                }<br>
        }<br>
@@ -445,7 +446,7 @@ main (int argc, char *argv[])<br>
        if (load_config(DEFAULT_CONFIGFILE, udev))<br>
                exit(1);<br>
<br>
-       while ((arg = getopt(argc, argv, ":adchl::FfM:v:p:b:BrtqwW")) != EOF ) {<br>
+       while ((arg = getopt(argc, argv, ":adchl::FfM:v:p:b:BritqwW")) != EOF ) {<br>
                switch(arg) {<br>
                case 1: printf("optarg : %s\n",optarg);<br>
                        break;<br>
@@ -503,6 +504,9 @@ main (int argc, char *argv[])<br>
                case 'r':<br>
                        conf->force_reload = 1;<br>
                        break;<br>
+               case 'i':<br>
+                       conf->ignore_wwids = 1;<br>
+                       break;<br>
                case 't':<br>
                        r = dump_config();<br>
                        goto out_free_config;<br>
diff --git a/multipath/multipath.8 b/multipath/multipath.8<br>
index b6479b1..13e2e89 100644<br>
--- a/multipath/multipath.8<br>
+++ b/multipath/multipath.8<br>
@@ -8,7 +8,7 @@ multipath \- Device mapper target autoconfig<br>
 .RB [\| \-b\ \c<br>
 .IR bindings_file \|]<br>
 .RB [\| \-d \|]<br>
-.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-q | \|-r | \-a | \-w | \-W \|]<br>
+.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-q | \|-r | \|-i | \-a | \-w | \-W \|]<br>
 .RB [\| \-p\ \c<br>
 .BR failover | multibus | group_by_serial | group_by_prio | group_by_node_name \|]<br>
 .RB [\| device \|]<br>
@@ -55,6 +55,9 @@ print internal hardware table to stdout<br>
 .B \-r<br>
 force devmap reload<br>
 .TP<br>
+.B \-i<br>
+ignore wwids file when processing devices<br>
+.TP<br>
 .B \-B<br>
 treat the bindings file as read only<br>
 .TP<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.4.5<br>
<br>
</font></span></blockquote></div><br></div>