From: Daniel P. Berrangé Date: Thu, 17 Mar 2022 17:50:43 +0000 (+0000) Subject: qemu: fix recording of CPU deprecations X-Git-Tag: v8.2.0-rc1~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d31c39a83c1d911c478561aaf40729a529e3283e;p=thirdparty%2Flibvirt.git qemu: fix recording of CPU deprecations The code parsing thue query-cpu-definitions response will short-circuit the for loop in the case where usable=yes, resulting in us failing to parse the CPU deprecation flag. IOW, we only reported deprecations in domain capabilities for CPU models which were not runnable on the host. Reviewed-by: Michal Privoznik Signed-off-by: Daniel P. Berrangé --- diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 27c5e1c992..d5622bd6d9 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -5309,10 +5309,9 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitor *mon, if (g_strv_length(cpu->blockers) == 0) { cpu->usable = VIR_DOMCAPS_CPU_USABLE_YES; g_clear_pointer(&cpu->blockers, g_strfreev); - continue; + } else { + cpu->usable = VIR_DOMCAPS_CPU_USABLE_NO; } - - cpu->usable = VIR_DOMCAPS_CPU_USABLE_NO; } if (virJSONValueObjectHasKey(child, "deprecated") &&