Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy(a)virtuozzo.com>
---
src/qemu/qemu_process.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 8706de3..46a39ac 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -8193,8 +8193,7 @@ static int
qemuProcessRefreshLegacyBlockjobs(virQEMUDriverPtr driver,
virDomainObjPtr vm)
{
- GHashTable *blockJobs = NULL;
- int ret = -1;
+ g_autoptr(GHashTable) blockJobs = NULL;
size_t i;
for (i = 0; i < vm->def->ndisks; i++) {
@@ -8209,10 +8208,10 @@ qemuProcessRefreshLegacyBlockjobs(virQEMUDriverPtr driver,
qemuDomainObjEnterMonitor(driver, vm);
blockJobs = qemuMonitorGetAllBlockJobInfo(qemuDomainGetMonitor(vm), true);
if (qemuDomainObjExitMonitor(driver, vm) < 0 || !blockJobs)
- goto cleanup;
+ return -1;
if (virHashForEach(blockJobs, qemuProcessRefreshLegacyBlockjob, vm) < 0)
- goto cleanup;
+ return -1;
/*
* At this point we can have outdated pending events in job->newstate.
@@ -8227,11 +8226,7 @@ qemuProcessRefreshLegacyBlockjobs(virQEMUDriverPtr driver,
qemuBlockJobStartupFinalize(vm, job);
}
- ret = 0;
-
- cleanup:
- virHashFree(blockJobs);
- return ret;
+ return 0;
}
--
1.8.3.1