Re: [libvirt PATCH] qemu: Do not pass negative ncpus to virCapabilitiesClearHostNUMACellCPUTopology

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

 



On 11/4/21 7:54 PM, Jiri Denemark wrote:
> It won't cause any harm as cpus is NULL when we pass a negative ncpus,
> but doing so when the function expects unsigned value is not right.
> 
> Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
> ---
>  src/conf/capabilities.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
> index a3e68741a9..cea4803fc8 100644
> --- a/src/conf/capabilities.c
> +++ b/src/conf/capabilities.c
> @@ -1954,6 +1954,7 @@ virCapabilitiesHostNUMAInitReal(virCapsHostNUMA *caps)
>              if (ncpus == -2)
>                  continue;
>  
> +            ncpus = 0;
>              goto cleanup;
>          }
>  
> 

Alternatively, we may just 'return -1' instead of 'goto cleanup'.

Reviewed-by: Michal Privoznik <mprivozn@xxxxxxxxxx>

Michal




[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