storage: Improve code consistency between backends

This improves the code consistency around freeing vol->target.path in
createVol implementations.
This commit is contained in:
Richard Laager 2016-03-15 01:17:33 -05:00 committed by Roman Bogorodskiy
parent ed0221d6b3
commit 98ee86e76c
2 changed files with 1 additions and 7 deletions

View File

@ -921,9 +921,7 @@ virStorageBackendLogicalCreateVol(virConnectPtr conn,
vol->type = VIR_STORAGE_VOL_BLOCK;
/* A target path passed to CreateVol has no meaning */
VIR_FREE(vol->target.path);
if (virAsprintf(&vol->target.path, "%s/%s",
pool->def->target.path,
vol->name) == -1)

View File

@ -303,11 +303,7 @@ virStorageBackendZFSCreateVol(virConnectPtr conn ATTRIBUTE_UNUSED,
vol->type = VIR_STORAGE_VOL_BLOCK;
if (vol->target.path != NULL) {
/* A target path passed to CreateVol has no meaning */
VIR_FREE(vol->target.path);
}
VIR_FREE(vol->target.path);
if (virAsprintf(&vol->target.path, "%s/%s",
pool->def->target.path, vol->name) == -1)
return -1;