storage: Create enough volumes for mpath pool

"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
This commit is contained in:
Osier Yang 2011-02-15 10:12:24 +08:00
parent d4b230c8fc
commit b958419534

View 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: