1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-26 03:21:44 +03:00

qemu_migration_params.c: modernize qemuMigrationParamsFetch()

Use g_autoptr() and remove the 'cleanup' label.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Daniel Henrique Barboza 2020-07-13 06:49:41 -03:00 committed by Michal Privoznik
parent db64224bca
commit 5b4ae09e71

View File

@ -1092,28 +1092,23 @@ qemuMigrationParamsFetch(virQEMUDriverPtr driver,
qemuMigrationParamsPtr *migParams)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
virJSONValuePtr jsonParams = NULL;
int ret = -1;
g_autoptr(virJSONValue) jsonParams = NULL;
int rc;
*migParams = NULL;
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
goto cleanup;
return -1;
rc = qemuMonitorGetMigrationParams(priv->mon, &jsonParams);
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
goto cleanup;
return -1;
if (!(*migParams = qemuMigrationParamsFromJSON(jsonParams)))
goto cleanup;
return -1;
ret = 0;
cleanup:
virJSONValueFree(jsonParams);
return ret;
return 0;
}