Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx> --- src/qemu/qemu_driver.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index b8ba2e3fb9..8e81c30a93 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -13150,7 +13150,6 @@ qemuConnectCPUModelComparison(virQEMUCapsPtr qemuCaps, { g_autoptr(qemuProcessQMP) proc = NULL; g_autofree char *result = NULL; - int ret = VIR_CPU_COMPARE_ERROR; if (!(proc = qemuProcessQMPNew(virQEMUCapsGetBinary(qemuCaps), libDir, runUid, runGid, false))) @@ -13163,15 +13162,17 @@ qemuConnectCPUModelComparison(virQEMUCapsPtr qemuCaps, return VIR_CPU_COMPARE_ERROR; if (STREQ(result, "identical")) - ret = VIR_CPU_COMPARE_IDENTICAL; - else if (STREQ(result, "superset")) - ret = VIR_CPU_COMPARE_SUPERSET; - else if (failIncompatible) + return VIR_CPU_COMPARE_IDENTICAL; + + if (STREQ(result, "superset")) + return VIR_CPU_COMPARE_SUPERSET; + + if (failIncompatible) { virReportError(VIR_ERR_CPU_INCOMPATIBLE, NULL); - else - ret = VIR_CPU_COMPARE_INCOMPATIBLE; + return VIR_CPU_COMPARE_ERROR; + } - return ret; + return VIR_CPU_COMPARE_INCOMPATIBLE; } -- 2.27.0