]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: do not compare missing cpu data
authorJán Tomko <jtomko@redhat.com>
Wed, 8 Dec 2021 12:13:35 +0000 (13:13 +0100)
committerJán Tomko <jtomko@redhat.com>
Wed, 8 Dec 2021 14:27:58 +0000 (15:27 +0100)
For x86, we invalidate qemu caps cache if the host CPUID changed.
However other cpu drivers do not have the 'getHostData' function
implemented.

Skip the comparison if we do not have host CPUData available,
since virCPUDataIsIdentical always returns an error in that case.

https://bugzilla.redhat.com/show_bug.cgi?id=2030119

Fixes: 3bc6f46d305ed82f7314ffc4c2a66847b831a6bd
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
src/qemu/qemu_capabilities.c

index 0e6e73774a0408b85ed687d4d3d1872c5ec25c40..4ffd0a98a2e9aae3d5fa162cc426769c2dcb7718 100644 (file)
@@ -4943,8 +4943,8 @@ virQEMUCapsIsValid(void *data,
             return false;
         }
 
-        if (virCPUDataIsIdentical(priv->cpuData, qemuCaps->cpuData) !=
-            VIR_CPU_COMPARE_IDENTICAL) {
+        if (priv->cpuData &&
+            virCPUDataIsIdentical(priv->cpuData, qemuCaps->cpuData) != VIR_CPU_COMPARE_IDENTICAL) {
             VIR_DEBUG("Outdated capabilities for '%s': host cpuid changed",
                       qemuCaps->binary);
             return false;