mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
qemuRefreshPRManagerState: Automatically free GHashTable and refactor cleanup
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
b59430d107
commit
6e9ddad43b
@ -2291,25 +2291,22 @@ qemuRefreshPRManagerState(virQEMUDriver *driver,
|
|||||||
virDomainObj *vm)
|
virDomainObj *vm)
|
||||||
{
|
{
|
||||||
qemuDomainObjPrivate *priv = vm->privateData;
|
qemuDomainObjPrivate *priv = vm->privateData;
|
||||||
GHashTable *info = NULL;
|
g_autoptr(GHashTable) info = NULL;
|
||||||
int ret = -1;
|
int rc;
|
||||||
|
|
||||||
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_PR_MANAGER_HELPER) ||
|
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_PR_MANAGER_HELPER) ||
|
||||||
!qemuDomainDefHasManagedPR(vm))
|
!qemuDomainDefHasManagedPR(vm))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
qemuDomainObjEnterMonitor(driver, vm);
|
qemuDomainObjEnterMonitor(driver, vm);
|
||||||
ret = qemuMonitorGetPRManagerInfo(priv->mon, &info);
|
rc = qemuMonitorGetPRManagerInfo(priv->mon, &info);
|
||||||
qemuDomainObjExitMonitor(driver, vm);
|
qemuDomainObjExitMonitor(driver, vm);
|
||||||
|
|
||||||
if (ret < 0)
|
if (rc < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
ret = qemuProcessRefreshPRManagerState(vm, info);
|
|
||||||
|
|
||||||
cleanup:
|
return qemuProcessRefreshPRManagerState(vm, info);
|
||||||
virHashFree(info);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user