Do not print empty device strings during discovery
authorHannes Reinecke <hare@suse.de>
Wed, 9 Apr 2014 10:03:27 +0000 (12:03 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Sun, 29 Mar 2015 15:44:34 +0000 (17:44 +0200)
If the path provides no information we should not print out
empty strings, but rather an instructive message telling us so.

References: bnc#872712

Signed-off-by: Hannes Reinecke <hare@suse.de>
libmultipath/structs_vec.c

index a15e3c0..a1f2212 100644 (file)
@@ -226,6 +226,12 @@ extract_hwe_from_path(struct multipath * mpp)
        }
 
        if (pp) {
+               if (!strlen(pp->vendor_id) ||
+                   !strlen(pp->product_id) ||
+                   !strlen(pp->rev)) {
+                       condlog(3, "%s: no device details available", pp->dev);
+                       return NULL;
+               }
                condlog(3, "%s: vendor = %s", pp->dev, pp->vendor_id);
                condlog(3, "%s: product = %s", pp->dev, pp->product_id);
                condlog(3, "%s: rev = %s", pp->dev, pp->rev);