]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
cpu_ppc64: compare CPU function is ignoring return value
authorJulio Faracco <jcfaracco@gmail.com>
Tue, 27 Oct 2020 16:04:24 +0000 (13:04 -0300)
committerJán Tomko <jtomko@redhat.com>
Wed, 4 Nov 2020 16:13:49 +0000 (17:13 +0100)
Function to compare CPU on 64-bits PowerPC is ignoring the flag to avoid failure
in case of CPUs (host and guest) are incompatible. Basically, the function is
returning -1 even if it is set to continue.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
src/cpu/cpu_ppc64.c

index 2fedcd25daffcbb24d1c6a2bfec6ddff58e43814..555eeecbe7f96d1aa94114278749e94f3606af4a 100644 (file)
@@ -524,11 +524,11 @@ virCPUppc64Compare(virCPUDefPtr host,
         if (failIncompatible) {
             virReportError(VIR_ERR_CPU_INCOMPATIBLE, "%s",
                            _("unknown host CPU"));
-        } else {
-            VIR_WARN("unknown host CPU");
-            ret = VIR_CPU_COMPARE_INCOMPATIBLE;
+            return VIR_CPU_COMPARE_ERROR;
         }
-        return -1;
+
+        VIR_WARN("unknown host CPU");
+        return VIR_CPU_COMPARE_INCOMPATIBLE;
     }
 
     ret = ppc64Compute(host, cpu, NULL, &message);