Re: libvirtd crash with host cpu model qemu64

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

 



On 05.08.2016 23:38, Jim Fehlig wrote:
> <snip/>
> With vendor = 0x0,  &host_model->vendor->cpuid evaluates to 8, which
> is not a nice value to pass to virCPUx86DataAddCPUID(). Check for a
> non-null host_model->vendor before calling virCPUx86DataAddCPUID().
> 
> Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxx>
> ---
>  src/cpu/cpu_x86.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
> index d9646eb..09eaaa2 100644
> --- a/src/cpu/cpu_x86.c
> +++ b/src/cpu/cpu_x86.c
> @@ -1576,7 +1576,7 @@ x86Compute(virCPUDefPtr host,
>          if (!(guest_model = x86ModelCopy(host_model)))
>              goto error;
>  
> -        if (cpu->vendor &&
> +        if (cpu->vendor && host_model->vendor &&
>              virCPUx86DataAddCPUID(&guest_model->data,
>                                    &host_model->vendor->cpuid) < 0)
>              goto error;


Looks reasonable to me. If there's no host vendor, we shouldn't add the
CPU to our database.

ACK if you write some sensible commit message to your patch.

Michal

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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]