]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Change return type of qemuDomainFixupCPUs to void
authorJiri Denemark <jdenemar@redhat.com>
Wed, 17 Apr 2024 12:28:24 +0000 (14:28 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 17 Apr 2024 15:36:59 +0000 (17:36 +0200)
The function never fails.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_domain.c
src/qemu/qemu_domain.h
src/qemu/qemu_process.c

index 3dfabfda2fd6161c132f9ff4dc2711a4f38c7907..3469f0d40c59e84235937449395b73606630b743 100644 (file)
@@ -11050,29 +11050,27 @@ qemuDomainUpdateCPU(virDomainObj *vm,
  *
  * This function can only be used on an active domain or when restoring a
  * domain which was running.
- *
- * Returns 0 on success, -1 on error.
  */
-int
+void
 qemuDomainFixupCPUs(virDomainObj *vm,
                     virCPUDef **origCPU)
 {
     virArch arch = vm->def->os.arch;
 
     if (!ARCH_IS_X86(arch))
-        return 0;
+        return;
 
     if (!vm->def->cpu ||
         vm->def->cpu->mode != VIR_CPU_MODE_CUSTOM ||
         !vm->def->cpu->model)
-        return 0;
+        return;
 
     /* Missing origCPU means QEMU created exactly the same virtual CPU which
      * we asked for or libvirt was too old to mess up the translation from
      * host-model.
      */
     if (!*origCPU)
-        return 0;
+        return;
 
     if (virCPUDefFindFeature(vm->def->cpu, "cmt")) {
         g_autoptr(virCPUDef) fixedCPU = virCPUDefCopyWithoutModel(vm->def->cpu);
@@ -11093,8 +11091,6 @@ qemuDomainFixupCPUs(virDomainObj *vm,
         virCPUDefFree(*origCPU);
         *origCPU = g_steal_pointer(&fixedOrig);
     }
-
-    return 0;
 }
 
 
index 264817eef9bb8084e8eaca9f764da4c2d241c495..a3089ea4494f4376dd9ea85f497b77438fae2870 100644 (file)
@@ -985,7 +985,7 @@ qemuDomainUpdateCPU(virDomainObj *vm,
                     virCPUDef *cpu,
                     virCPUDef **origCPU);
 
-int
+void
 qemuDomainFixupCPUs(virDomainObj *vm,
                     virCPUDef **origCPU);
 
index 284b917df94bd302dc490e90a72a1d99d6817902..da2b024f92d7a7f958ad0fdc236b61d1cb8f47a5 100644 (file)
@@ -8278,9 +8278,8 @@ qemuProcessStartWithMemoryState(virConnectPtr conn,
     /* No cookie means libvirt which saved the domain was too old to mess up
      * the CPU definitions.
      */
-    if (cookie &&
-        qemuDomainFixupCPUs(vm, &cookie->cpu) < 0)
-        return -1;
+    if (cookie)
+        qemuDomainFixupCPUs(vm, &cookie->cpu);
 
     if (cookie && !cookie->slirpHelper)
         priv->disableSlirp = true;
@@ -8926,8 +8925,7 @@ qemuProcessRefreshCPU(virQEMUDriver *driver,
          * case the host-model is known to not contain features which QEMU
          * doesn't know about.
          */
-        if (qemuDomainFixupCPUs(vm, &priv->origCPU) < 0)
-            return -1;
+        qemuDomainFixupCPUs(vm, &priv->origCPU);
     }
 
     return 0;