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)
|
||||
{
|
||||
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);
|
||||
rc = qemuMonitorGetPRManagerInfo(priv->mon, &info);
|
||||
qemuDomainObjExitMonitor(driver, vm);
|
||||
|
||||
if (ret < 0)
|
||||
goto cleanup;
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
|
||||
ret = qemuProcessRefreshPRManagerState(vm, info);
|
||||
|
||||
cleanup:
|
||||
virHashFree(info);
|
||||
return ret;
|
||||
return qemuProcessRefreshPRManagerState(vm, info);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user