Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_process.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 8dface7ec0..2fdd5b95e2 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2291,26 +2291,19 @@ qemuRefreshPRManagerState(virQEMUDriver *driver,
virDomainObj *vm)
{
qemuDomainObjPrivate *priv = vm->privateData;
- GHashTable *info = NULL;
- int ret = -1;
+ g_autoptr(GHashTable) info = NULL;
+ int rc;
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_PR_MANAGER_HELPER) ||
!qemuDomainDefHasManagedPR(vm))
return 0;
qemuDomainObjEnterMonitor(driver, vm);
- ret = qemuMonitorGetPRManagerInfo(priv->mon, &info);
- if (qemuDomainObjExitMonitor(driver, vm) < 0)
- ret = -1;
-
- if (ret < 0)
- goto cleanup;
-
- ret = qemuProcessRefreshPRManagerState(vm, info);
+ rc = qemuMonitorGetPRManagerInfo(priv->mon, &info);
+ if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
+ return -1;
- cleanup:
- virHashFree(info);
- return ret;
+ return qemuProcessRefreshPRManagerState(vm, info);
}
--
2.31.1