mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
storage: Improve code consistency between backends
This improves the code consistency around freeing vol->target.path in createVol implementations.
This commit is contained in:
parent
ed0221d6b3
commit
98ee86e76c
@ -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)
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user