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

qemu_monitor_json.c: modernize qemuMonitorJSONMigrateIncoming()

Use g_autoptr() and remove the now obsolete '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:44 -03:00 committed by Michal Privoznik
parent b75ff9a194
commit d9ea60c0a0

View File

@ -8405,9 +8405,8 @@ int
qemuMonitorJSONMigrateIncoming(qemuMonitorPtr mon, qemuMonitorJSONMigrateIncoming(qemuMonitorPtr mon,
const char *uri) const char *uri)
{ {
int ret = -1; g_autoptr(virJSONValue) cmd = NULL;
virJSONValuePtr cmd; g_autoptr(virJSONValue) reply = NULL;
virJSONValuePtr reply = NULL;
if (!(cmd = qemuMonitorJSONMakeCommand("migrate-incoming", if (!(cmd = qemuMonitorJSONMakeCommand("migrate-incoming",
"s:uri", uri, "s:uri", uri,
@ -8415,14 +8414,9 @@ qemuMonitorJSONMigrateIncoming(qemuMonitorPtr mon,
return -1; return -1;
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
goto cleanup; return -1;
ret = qemuMonitorJSONCheckError(cmd, reply); return qemuMonitorJSONCheckError(cmd, reply);
cleanup:
virJSONValueFree(cmd);
virJSONValueFree(reply);
return ret;
} }