]> xenbits.xensource.com Git - libvirt.git/commitdiff
virQEMUCapsGetMachineTypesCaps: Remove return value
authorPeter Krempa <pkrempa@redhat.com>
Fri, 17 Mar 2023 13:14:45 +0000 (14:14 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 3 Apr 2023 07:19:07 +0000 (09:19 +0200)
The function always returns 0.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_capabilities.c

index 25efd25a6a9c654a31e0f62c19f1a3b49eaadc64..877b72592031db898b96f00cc4e82ae1197b7f44 100644 (file)
@@ -1015,7 +1015,7 @@ virQEMUCapsInitGuest(virCaps *caps,
 }
 
 
-static int
+static void
 virQEMUCapsGetMachineTypesCaps(virQEMUCaps *qemuCaps,
                                size_t *nmachines,
                                virCapsGuestMachine ***machines)
@@ -1037,7 +1037,7 @@ virQEMUCapsGetMachineTypesCaps(virQEMUCaps *qemuCaps,
     *nmachines = accel->nmachineTypes;
 
     if (*nmachines == 0)
-        return 0;
+        return;
 
     array = g_ptr_array_sized_new(*nmachines);
 
@@ -1093,8 +1093,6 @@ virQEMUCapsGetMachineTypesCaps(virQEMUCaps *qemuCaps,
     *machines = g_new0(virCapsGuestMachine *, array->len);
     for (i = 0; i < array->len; ++i)
         (*machines)[i] = g_ptr_array_index(array, i);
-
-    return 0;
 }
 
 
@@ -1112,8 +1110,7 @@ virQEMUCapsInitGuestFromBinary(virCaps *caps,
     if (!binary)
         return 0;
 
-    if (virQEMUCapsGetMachineTypesCaps(qemuCaps, &nmachines, &machines) < 0)
-        goto cleanup;
+    virQEMUCapsGetMachineTypesCaps(qemuCaps, &nmachines, &machines);
 
     /* We register kvm as the base emulator too, since we can
      * just give -no-kvm to disable acceleration if required */
@@ -1160,8 +1157,6 @@ virQEMUCapsInitGuestFromBinary(virCaps *caps,
 
     ret = 0;
 
- cleanup:
-
     virCapabilitiesFreeMachines(machines, nmachines);
 
     return ret;