diff mbox

storage: mpath: Don't error on target_type=NULL

Message ID 8b02d8e00d86809832c47de8ce3fb7502c30abac.1460583313.git.crobinso@redhat.com
State Accepted
Commit 8f8c0feb113420625f15b7f1e17bfd719c977eeb
Headers show

Commit Message

Cole Robinson April 13, 2016, 9:35 p.m. UTC
We use device-mapper to enumerate all dm devices, and filter out
the list of multipath devices by checking the target_type string
name. The code however cancels all scanning if we encounter
target_type=NULL

I don't know how to reproduce that situation, but a user was hitting
it in their setup, and inspecting the lvm2/device-mapper code shows
many places where !target_type is explicitly ignored and processing
continues on to the next device. So I think we should do the same

https://bugzilla.redhat.com/show_bug.cgi?id=1069317
---
 src/storage/storage_backend_mpath.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

-- 
2.7.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
diff mbox

Patch

diff --git a/src/storage/storage_backend_mpath.c b/src/storage/storage_backend_mpath.c
index b5b4bb6..bf1b1ab 100644
--- a/src/storage/storage_backend_mpath.c
+++ b/src/storage/storage_backend_mpath.c
@@ -114,12 +114,7 @@  virStorageBackendIsMultipath(const char *dev_name)
 
     dm_get_next_target(dmt, next, &start, &length, &target_type, &params);
 
-    if (target_type == NULL) {
-        ret = -1;
-        goto out;
-    }
-
-    if (STREQ(target_type, "multipath"))
+    if (STREQ_NULLABLE(target_type, "multipath"))
         ret = 1;
 
  out: