virQEMUCapsInitGuestFromBinary: Refactor cleanup

Remove useless call to virCapabilitiesFreeMachines as the pointers were
cleared and the unneeded 'ret' variable. Since we don't need to clear
the 'machines' pointer now, remove that as well.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2023-03-17 14:18:58 +01:00
parent 58e1b19aef
commit 6481b06a19

View File

@ -1105,7 +1105,6 @@ virQEMUCapsInitGuestFromBinary(virCaps *caps,
virCapsGuest *guest;
virCapsGuestMachine **machines = NULL;
size_t nmachines = 0;
int ret = -1;
if (!binary)
return 0;
@ -1118,9 +1117,6 @@ virQEMUCapsInitGuestFromBinary(virCaps *caps,
guestarch, binary,
NULL, nmachines, machines);
machines = NULL;
nmachines = 0;
/* CPU selection is always available, because all QEMU versions
* we support can use at least '-cpu host' */
virCapabilitiesAddGuestFeature(guest, VIR_CAPS_GUEST_FEATURE_TYPE_CPUSELECTION);
@ -1155,11 +1151,7 @@ virQEMUCapsInitGuestFromBinary(virCaps *caps,
virCapabilitiesAddGuestFeature(guest, VIR_CAPS_GUEST_FEATURE_TYPE_NONPAE);
}
ret = 0;
virCapabilitiesFreeMachines(machines, nmachines);
return ret;
return 0;
}