[libmultipath] scope limiting fixes
authorChristophe Varoqui <cvaroqui@zezette.localdomain>
Tue, 14 Nov 2006 21:26:38 +0000 (22:26 +0100)
committerChristophe Varoqui <cvaroqui@zezette.localdomain>
Tue, 14 Nov 2006 21:26:38 +0000 (22:26 +0100)
I messed up the patch a bit.  Apparently dm_get_uuid() can
return a zero without actually having found a dm name which
matches the name parameter.

Also, I changed dm_get_uuid() so it either returns 1 or a null
string in the uuid return parameter -- in 2 different cases
it was doing neither.

The <dm_device_name> qualifier for the command line
"multipath -ll <dm device name>" can now accept up
to 3 different names for the same dm mapped device,
that is, a user friendly name, an alias in
/etc/multipath.conf, and the current name as
reported by "dmsetup ls".

Edward Goggin, EMC

libmultipath/configure.c
libmultipath/devmapper.c

index 9578bee..b66cf23 100644 (file)
@@ -603,7 +603,7 @@ get_refwwid (char * dev, enum devtypes dev_type, vector pathvec)
        }
        if (dev_type == DEV_DEVMAP) {
 
-               if ((dm_get_uuid(dev, tmpwwid)) == 0) {
+               if (((dm_get_uuid(dev, tmpwwid)) == 0) && (strlen(tmpwwid))) {
                        refwwid = tmpwwid;
                        goto out;
                }
index 69eecde..b8571ad 100644 (file)
@@ -223,6 +223,7 @@ dm_get_uuid(char *name, char *uuid)
 {
        struct dm_task *dmt;
        const char *uuidtmp;
+       int r = 1;
 
        dmt = dm_task_create(DM_DEVICE_INFO);
        if (!dmt)
@@ -244,10 +245,10 @@ dm_get_uuid(char *name, char *uuid)
        else
                uuid[0] = '\0';
 
+       r = 0;
 uuidout:
        dm_task_destroy(dmt);
-
-       return 0;
+       return r;
 }
 
 extern int