]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage: Create enough volumes for mpath pool
authorOsier Yang <jyang@redhat.com>
Tue, 15 Feb 2011 02:12:24 +0000 (10:12 +0800)
committerOsier Yang <jyang@redhat.com>
Tue, 15 Feb 2011 02:12:24 +0000 (10:12 +0800)
"virStorageBackendCreateVols":
  "names->next" serves as condition expression for "do...while",
however, "names" was shifted before, it then results in one less
loop, and thus, one less volume will be created for mpath pool,
the patch is to fix it.

* src/storage/storage_backend_mpath.c

src/storage/storage_backend_mpath.c

index be4db787855f56ab6895453f5f29b3e59a6ac178..2e8556170834c8e646b36c2b58fcdc093dd6bde1 100644 (file)
@@ -212,6 +212,7 @@ virStorageBackendCreateVols(virStoragePoolObjPtr pool,
     int retval = -1, is_mpath = 0;
     char *map_device = NULL;
     uint32_t minor = -1;
+    uint32_t next;
 
     do {
         is_mpath = virStorageBackendIsMultipath(names->name);
@@ -243,9 +244,10 @@ virStorageBackendCreateVols(virStoragePoolObjPtr pool,
 
         /* Given the way libdevmapper returns its data, I don't see
          * any way to avoid this series of casts. */
-        names = (struct dm_names *)(((char *)names) + names->next);
+        next = names->next;
+        names = (struct dm_names *)(((char *)names) + next);
 
-    } while (names->next);
+    } while (next);
 
     retval = 0;
 out: