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 <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2022-03-17 17:50:43 +00:00
parent af6f6091e0
commit d31c39a83c

View File

@ -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") &&