mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-25 22:15:20 +00:00
qemu: agent: remove cleanup in qemuAgentGetInterfaces
Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
parent
00311ef603
commit
ddc2e51767
@ -2214,7 +2214,6 @@ int
|
|||||||
qemuAgentGetInterfaces(qemuAgentPtr agent,
|
qemuAgentGetInterfaces(qemuAgentPtr agent,
|
||||||
virDomainInterfacePtr **ifaces)
|
virDomainInterfacePtr **ifaces)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
|
||||||
size_t i;
|
size_t i;
|
||||||
g_autoptr(virJSONValue) cmd = NULL;
|
g_autoptr(virJSONValue) cmd = NULL;
|
||||||
g_autoptr(virJSONValue) reply = NULL;
|
g_autoptr(virJSONValue) reply = NULL;
|
||||||
@ -2227,15 +2226,15 @@ qemuAgentGetInterfaces(qemuAgentPtr agent,
|
|||||||
ifaces_store = virHashNew(NULL);
|
ifaces_store = virHashNew(NULL);
|
||||||
|
|
||||||
if (!(cmd = qemuAgentMakeCommand("guest-network-get-interfaces", NULL)))
|
if (!(cmd = qemuAgentMakeCommand("guest-network-get-interfaces", NULL)))
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
if (qemuAgentCommand(agent, cmd, &reply, agent->timeout) < 0)
|
if (qemuAgentCommand(agent, cmd, &reply, agent->timeout) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
if (!(ret_array = virJSONValueObjectGetArray(reply, "return"))) {
|
if (!(ret_array = virJSONValueObjectGetArray(reply, "return"))) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("qemu agent didn't return an array of interfaces"));
|
_("qemu agent didn't return an array of interfaces"));
|
||||||
goto cleanup;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < virJSONValueArraySize(ret_array); i++) {
|
for (i = 0; i < virJSONValueArraySize(ret_array); i++) {
|
||||||
@ -2247,10 +2246,7 @@ qemuAgentGetInterfaces(qemuAgentPtr agent,
|
|||||||
}
|
}
|
||||||
|
|
||||||
*ifaces = g_steal_pointer(&ifaces_ret);
|
*ifaces = g_steal_pointer(&ifaces_ret);
|
||||||
ret = ifaces_count;
|
return ifaces_count;
|
||||||
|
|
||||||
cleanup:
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
error:
|
error:
|
||||||
if (ifaces_ret) {
|
if (ifaces_ret) {
|
||||||
@ -2258,7 +2254,7 @@ qemuAgentGetInterfaces(qemuAgentPtr agent,
|
|||||||
virDomainInterfaceFree(ifaces_ret[i]);
|
virDomainInterfaceFree(ifaces_ret[i]);
|
||||||
}
|
}
|
||||||
VIR_FREE(ifaces_ret);
|
VIR_FREE(ifaces_ret);
|
||||||
goto cleanup;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user