提交 e05d211f 编写于 作者: P Peter Krempa

qemu: Modernize memory cleaning in qemuDomainBlockCommit

Use VIR_AUTOFREE and VIR_AUTOUNREF.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 82b3f470
...@@ -17961,10 +17961,10 @@ qemuDomainBlockCommit(virDomainPtr dom, ...@@ -17961,10 +17961,10 @@ qemuDomainBlockCommit(virDomainPtr dom,
unsigned int flags) unsigned int flags)
{ {
virQEMUDriverPtr driver = dom->conn->privateData; virQEMUDriverPtr driver = dom->conn->privateData;
virQEMUDriverConfigPtr cfg = NULL; VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg = NULL;
qemuDomainObjPrivatePtr priv; qemuDomainObjPrivatePtr priv;
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
char *device = NULL; VIR_AUTOFREE(char *) device = NULL;
int ret = -1; int ret = -1;
virDomainDiskDefPtr disk = NULL; virDomainDiskDefPtr disk = NULL;
virStorageSourcePtr topSource; virStorageSourcePtr topSource;
...@@ -17973,9 +17973,9 @@ qemuDomainBlockCommit(virDomainPtr dom, ...@@ -17973,9 +17973,9 @@ qemuDomainBlockCommit(virDomainPtr dom,
unsigned int baseIndex = 0; unsigned int baseIndex = 0;
virStorageSourcePtr top_parent = NULL; virStorageSourcePtr top_parent = NULL;
bool clean_access = false; bool clean_access = false;
char *topPath = NULL; VIR_AUTOFREE(char *) topPath = NULL;
char *basePath = NULL; VIR_AUTOFREE(char *) basePath = NULL;
char *backingPath = NULL; VIR_AUTOFREE(char *) backingPath = NULL;
unsigned long long speed = bandwidth; unsigned long long speed = bandwidth;
qemuBlockJobDataPtr job = NULL; qemuBlockJobDataPtr job = NULL;
qemuBlockJobType jobtype = QEMU_BLOCKJOB_TYPE_COMMIT; qemuBlockJobType jobtype = QEMU_BLOCKJOB_TYPE_COMMIT;
...@@ -18174,11 +18174,6 @@ qemuDomainBlockCommit(virDomainPtr dom, ...@@ -18174,11 +18174,6 @@ qemuDomainBlockCommit(virDomainPtr dom,
qemuDomainObjEndJob(driver, vm); qemuDomainObjEndJob(driver, vm);
cleanup: cleanup:
VIR_FREE(topPath);
VIR_FREE(basePath);
VIR_FREE(backingPath);
VIR_FREE(device);
virObjectUnref(cfg);
virDomainObjEndAPI(&vm); virDomainObjEndAPI(&vm);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册