mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemuRefreshVirtioChannelState: 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
54a975ded6
commit
b59430d107
@ -2243,24 +2243,21 @@ qemuRefreshVirtioChannelState(virQEMUDriver *driver,
|
|||||||
qemuDomainAsyncJob asyncJob)
|
qemuDomainAsyncJob asyncJob)
|
||||||
{
|
{
|
||||||
qemuDomainObjPrivate *priv = vm->privateData;
|
qemuDomainObjPrivate *priv = vm->privateData;
|
||||||
GHashTable *info = NULL;
|
g_autoptr(GHashTable) info = NULL;
|
||||||
int ret = -1;
|
int rc;
|
||||||
|
|
||||||
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
|
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
ret = qemuMonitorGetChardevInfo(priv->mon, &info);
|
rc = qemuMonitorGetChardevInfo(priv->mon, &info);
|
||||||
qemuDomainObjExitMonitor(driver, vm);
|
qemuDomainObjExitMonitor(driver, vm);
|
||||||
|
|
||||||
if (ret < 0)
|
if (rc < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
qemuProcessRefreshChannelVirtioState(driver, vm, info, false);
|
qemuProcessRefreshChannelVirtioState(driver, vm, info, false);
|
||||||
ret = 0;
|
|
||||||
|
|
||||||
cleanup:
|
return 0;
|
||||||
virHashFree(info);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user