From patchwork Fri Jul 8 19:59:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Lackorzynski X-Patchwork-Id: 103934 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 613B51007D2 for ; Sat, 9 Jul 2011 06:02:07 +1000 (EST) Received: from localhost ([::1]:35440 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QfHFT-0002bU-Sy for incoming@patchwork.ozlabs.org; Fri, 08 Jul 2011 16:02:03 -0400 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 To: qemu-devel@nongnu.org Message-ID: <20110708195950.GA23040@os.inf.tu-dresden.de> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 141.76.48.99 Subject: [Qemu-devel] smp-parse: smp-opt-cores for simple -smp X X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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;