]> xenbits.xensource.com Git - libvirt.git/commitdiff
virQEMUCapsInitGuestFromBinary: Refactor cleanup
authorPeter Krempa <pkrempa@redhat.com>
Fri, 17 Mar 2023 13:18:58 +0000 (14:18 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 3 Apr 2023 07:19:07 +0000 (09:19 +0200)
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>
src/qemu/qemu_capabilities.c

index 877b72592031db898b96f00cc4e82ae1197b7f44..bbb1784a91c2bf3df41465cd52016152ba28f294 100644 (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;
 }