Signed-off-by: Peter Krempa <pkrempa(a)redhat.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 382d562fb1..5bbd03210b 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -8540,22 +8540,17 @@ static int
qemuProcessRefreshLegacyBlockjobs(virQEMUDriver *driver,
virDomainObj *vm)
{
- GHashTable *blockJobs = NULL;
- int ret = -1;
+ g_autoptr(GHashTable) blockJobs = NULL;
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;
-
- ret = 0;
+ return -1;
- cleanup:
- virHashFree(blockJobs);
- return ret;
+ return 0;
}
--
2.31.1