[libvirt] [PATCH 1/3] mpath: Update path in CheckPool function

John Ferlan jferlan at redhat.com
Wed Jun 24 13:06:26 UTC 2015


https://bugzilla.redhat.com/show_bug.cgi?id=1230664

Per the devmapper docs, use "/dev/mapper" or "/dev/dm-n" in order to
determine if a device is under control of DM Multipath.

So add "/dev/mapper" to the virFileExists, leaving the "/dev/mpath"
as a "legacy" option since it appears for a while it was the preferred
mechanism, but is no longer maintained

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 src/storage/storage_backend_mpath.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/storage/storage_backend_mpath.c b/src/storage/storage_backend_mpath.c
index 971408a..ca9a62f 100644
--- a/src/storage/storage_backend_mpath.c
+++ b/src/storage/storage_backend_mpath.c
@@ -248,7 +248,8 @@ static int
 virStorageBackendMpathCheckPool(virStoragePoolObjPtr pool ATTRIBUTE_UNUSED,
                                 bool *isActive)
 {
-    *isActive = virFileExists("/dev/mpath");
+    *isActive = virFileExists("/dev/mapper") ||
+                virFileExists("/dev/mpath");
     return 0;
 }
 
-- 
2.1.0




More information about the libvir-list mailing list