qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] vl: smp_parse: fix regression


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] vl: smp_parse: fix regression
Date: Tue, 21 Jun 2016 18:56:07 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1


On 21/06/2016 18:34, Andrew Jones wrote:
> Commit 0544edd88a "vl: smp_parse: cleanups" regressed any -smp
> config that left either cores or threads unspecified, and specified
> a topology supporting more cpus than the given online cpus. The
> correct way to calculate the missing parameter would be to use
> maxcpus, but it's too late to change that now. Restore the old
> way, which is to calculate it with the online cpus (as is still
> done), but then, if the result is zero, just set it to one.
> 
> Signed-off-by: Andrew Jones <address@hidden>
> ---
>  vl.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/vl.c b/vl.c
> index c85833a63c28e..b2137ca87078d 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -1234,8 +1234,10 @@ static void smp_parse(QemuOpts *opts)
>          } else if (cores == 0) {
>              threads = threads > 0 ? threads : 1;
>              cores = cpus / (sockets * threads);
> +            cores = cores > 0 ? cores : 1;
>          } else if (threads == 0) {
>              threads = cpus / (cores * sockets);
> +            threads = threads > 0 ? threads : 1;
>          } else if (sockets * cores * threads < cpus) {
>              error_report("cpu topology: "
>                           "sockets (%u) * cores (%u) * threads (%u) < "
> 

Queued, thanks.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]