From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:42516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QfHDQ-0002au-Hx for qemu-devel@nongnu.org; Fri, 08 Jul 2011 15:59:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QfHDO-00027d-Vc for qemu-devel@nongnu.org; Fri, 08 Jul 2011 15:59:56 -0400 Received: from os.inf.tu-dresden.de ([141.76.48.99]:51970) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QfHDO-00027V-Qa for qemu-devel@nongnu.org; Fri, 08 Jul 2011 15:59:54 -0400 Received: from erwin.inf.tu-dresden.de ([141.76.48.80] helo=os.inf.tu-dresden.de) by os.inf.tu-dresden.de with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) id 1QfHDM-0003yJ-KO for qemu-devel@nongnu.org; Fri, 08 Jul 2011 21:59:52 +0200 Date: Fri, 8 Jul 2011 21:59:50 +0200 From: Adam Lackorzynski Message-ID: <20110708195950.GA23040@os.inf.tu-dresden.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Subject: [Qemu-devel] smp-parse: smp-opt-cores for simple -smp X List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi, When just using a simple '-smp X', both the smp_cores and smp_threads variables are set to 1, which on x86 leads to CPUid-0x80000008-ecx returning 1 for the CPU count despite more CPUs are there. Docs say 'Missing values will be computed.', so my try on this is the following. Comments? Signed-off-by: Adam Lackorzynski --- vl.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/vl.c b/vl.c index fcd7395..1459bde 100644 --- a/vl.c +++ b/vl.c @@ -886,6 +886,8 @@ static void smp_parse(const char *optarg) max_cpus = strtoull(option, NULL, 10); /* compute missing values, prefer sockets over cores over threads */ + if (sockets + cores + threads == 0) + cores = smp; if (smp == 0 || sockets == 0) { sockets = sockets > 0 ? sockets : 1; cores = cores > 0 ? cores : 1; -- 1.7.5.3 Adam -- Adam adam@os.inf.tu-dresden.de Lackorzynski http://os.inf.tu-dresden.de/~adam/