From 33538bc46b7446525387b5555c58ea298c198c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Wed, 8 Dec 2021 13:13:35 +0100 Subject: [PATCH] qemu: do not compare missing cpu data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Jiri Denemark --- src/qemu/qemu_capabilities.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 0e6e73774a..4ffd0a98a2 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -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;