[PATCH v2] cpu_ppc64: compare CPU function is ignoring return value

Julio Faracco posted 1 patch 3 years, 6 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20201027160424.19259-1-jcfaracco@gmail.com
src/cpu/cpu_ppc64.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
[PATCH v2] cpu_ppc64: compare CPU function is ignoring return value
Posted by Julio Faracco 3 years, 6 months ago
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>
---
 src/cpu/cpu_ppc64.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c
index 2fedcd25da..555eeecbe7 100644
--- a/src/cpu/cpu_ppc64.c
+++ b/src/cpu/cpu_ppc64.c
@@ -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);
-- 
2.25.1

Re: [PATCH v2] cpu_ppc64: compare CPU function is ignoring return value
Posted by Ján Tomko 3 years, 5 months ago
On a Tuesday in 2020, Julio Faracco wrote:
>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>
>---
> src/cpu/cpu_ppc64.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano