[libmultipath] fix multipath renaming
authorChristophe Varoqui <root@xa-s05.(none)>
Mon, 28 Nov 2005 16:15:59 +0000 (17:15 +0100)
committerChristophe Varoqui <root@xa-s05.(none)>
Mon, 28 Nov 2005 16:15:59 +0000 (17:15 +0100)
This handles a rename from within multipath
now only via multipath.conf file.

Edward Goggin, EMC

libmultipath/configure.c
libmultipath/devmapper.c

index 640d8d8..6bd5824 100644 (file)
@@ -140,16 +140,16 @@ select_action (struct multipath * mpp, vector curmp)
                if (cmpp && !conf->dry_run) {
                        condlog(2, "%s: rename: %s to %s", mpp->wwid,
                                cmpp->alias, mpp->alias);
-                       dm_flush_map(cmpp->alias, DEFAULT_TARGET);
                        strncpy(mpp->alias_old, cmpp->alias, WWID_SIZE);
                        mpp->action = ACT_RENAME;
+                       return;
                }
                else {
                        condlog(3, "set ACT_CREATE: map does not exist");
                        mpp->action = ACT_CREATE;
                }
                mpp->action = ACT_CREATE;
-               condlog(3, "set ACT_CREATE: map does not exists");
+               condlog(3, "set ACT_CREATE: map does not exist");
                return;
        }
 
index 0f190af..0955fec 100644 (file)
@@ -844,11 +844,11 @@ out:
 int
 dm_rename (char * old, char * new)
 {
-       int r = 1;
+       int r = 0;
        struct dm_task *dmt;
 
        if (!(dmt = dm_task_create(DM_DEVICE_RENAME)))
-               return 0;
+               return r;
 
        if (!dm_task_set_name(dmt, old))
                goto out;
@@ -861,7 +861,7 @@ dm_rename (char * old, char * new)
        if (!dm_task_run(dmt))
                goto out;
 
-       r = 0;
+       r = 1;
 out:
        dm_task_destroy(dmt);
        return r;