提交 98ee86e7 编写于 作者: R Richard Laager 提交者: Roman Bogorodskiy

storage: Improve code consistency between backends

This improves the code consistency around freeing vol->target.path in
createVol implementations.
上级 ed0221d6
...@@ -921,9 +921,7 @@ virStorageBackendLogicalCreateVol(virConnectPtr conn, ...@@ -921,9 +921,7 @@ virStorageBackendLogicalCreateVol(virConnectPtr conn,
vol->type = VIR_STORAGE_VOL_BLOCK; vol->type = VIR_STORAGE_VOL_BLOCK;
/* 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", if (virAsprintf(&vol->target.path, "%s/%s",
pool->def->target.path, pool->def->target.path,
vol->name) == -1) vol->name) == -1)
......
...@@ -303,11 +303,7 @@ virStorageBackendZFSCreateVol(virConnectPtr conn ATTRIBUTE_UNUSED, ...@@ -303,11 +303,7 @@ virStorageBackendZFSCreateVol(virConnectPtr conn ATTRIBUTE_UNUSED,
vol->type = VIR_STORAGE_VOL_BLOCK; vol->type = VIR_STORAGE_VOL_BLOCK;
if (vol->target.path != NULL) { VIR_FREE(vol->target.path);
/* A target path passed to CreateVol has no meaning */
VIR_FREE(vol->target.path);
}
if (virAsprintf(&vol->target.path, "%s/%s", if (virAsprintf(&vol->target.path, "%s/%s",
pool->def->target.path, vol->name) == -1) pool->def->target.path, vol->name) == -1)
return -1; return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册