]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: fix recording of CPU deprecations
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 17 Mar 2022 17:50:43 +0000 (17:50 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Mon, 21 Mar 2022 09:18:02 +0000 (09:18 +0000)
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>
src/qemu/qemu_monitor_json.c

index 27c5e1c9922aa34cb0f1a26cb32811356bf0b7b4..d5622bd6d97caab8f53b241c09690c6953e747d8 100644 (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") &&