Re: [PATCH] qemu: Avoid crash in qemuDomainCheckCPU with unknown host CPU

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

 



On Tue, Feb 18, 2025 at 11:49:53AM +0100, Jiri Denemark wrote:
> When we don't have any information about host CPU (for example when
> running on an aarch64 host), the virQEMUCapsGetHostModel would return
> NULL.

Tested-by: Jaroslav Suchanek <jsuchane@xxxxxxxxxx>

> 
> Fixes: https://gitlab.com/libvirt/libvirt/-/issues/747
> Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
> ---
>  src/qemu/qemu_domain.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index cf05dca55a..df1ed0223d 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c
> @@ -11430,6 +11430,7 @@ qemuDomainCheckCPU(virArch arch,
>      /* Force compat check if the CPU model is not found in qemuCaps or
>       * we don't have host CPU data from QEMU */
>      if (!cpu->model ||
> +        !hypervisorCPU ||
>          hypervisorCPU->fallback != VIR_CPU_FALLBACK_FORBID ||
>          virQEMUCapsGetCPUBlockers(qemuCaps, virtType,
>                                    cpu->model, &blockers) < 0)
> -- 
> 2.48.1
> 

-- 
J.

Attachment: signature.asc
Description: PGP signature


[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