Re: [libvirt PATCH] qemu: do not compare missing cpu data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 08, 2021 at 13:24:04 +0100, Ján Tomko wrote:
> 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@xxxxxxxxxx>
> ---
>  src/qemu/qemu_capabilities.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index 0e6e73774a..51828ead53 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -4943,7 +4943,8 @@ virQEMUCapsIsValid(void *data,
>              return false;
>          }
>  
> -        if (virCPUDataIsIdentical(priv->cpuData, qemuCaps->cpuData) !=
> +        if (priv->cpuData &&
> +            virCPUDataIsIdentical(priv->cpuData, qemuCaps->cpuData) !=
>              VIR_CPU_COMPARE_IDENTICAL) {

While at it you could have placed VIR_CPU_COMPARE_IDENTICAL at the end
of the previous line.

>              VIR_DEBUG("Outdated capabilities for '%s': host cpuid changed",
>                        qemuCaps->binary);

Reviewed-by: Jiri Denemark <jdenemar@xxxxxxxxxx>




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux