From patchwork Fri Nov 7 16:04:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 408201 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6F70A1400D2 for ; Sat, 8 Nov 2014 03:07:40 +1100 (AEDT) Received: from localhost ([::1]:60856 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xmm4Y-0001w7-Hi for incoming@patchwork.ozlabs.org; Fri, 07 Nov 2014 11:07:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xmm1x-0007A2-2F for qemu-devel@nongnu.org; Fri, 07 Nov 2014 11:05:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xmm1q-0003aU-Sa for qemu-devel@nongnu.org; Fri, 07 Nov 2014 11:04:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37227) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xmm1q-0003aG-Lo for qemu-devel@nongnu.org; Fri, 07 Nov 2014 11:04:50 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sA7G4oJi021665 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 7 Nov 2014 11:04:50 -0500 Received: from hawk.usersys.redhat.com (dhcp-1-153.brq.redhat.com [10.34.1.153]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sA7G4iwC027938; Fri, 7 Nov 2014 11:04:49 -0500 From: Andrew Jones To: qemu-devel@nongnu.org Date: Fri, 7 Nov 2014 17:04:40 +0100 Message-Id: <1415376280-14130-4-git-send-email-drjones@redhat.com> In-Reply-To: <1415376280-14130-1-git-send-email-drjones@redhat.com> References: <1415376280-14130-1-git-send-email-drjones@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: pbonzini@redhat.com, ehabkost@redhat.com Subject: [Qemu-devel] [PATCH 3/3] vl: warn on topology <-> maxcpus mismatch 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 Start guiding users towards making sure their topology supports the maximum number of cpus they wish to support. A future patch series will enforce this for new machine types. Signed-off-by: Andrew Jones --- vl.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vl.c b/vl.c index c62fe29aa8075..72ffbffd858c5 100644 --- a/vl.c +++ b/vl.c @@ -1313,6 +1313,13 @@ static void smp_parse(QemuOpts *opts) } max_cpus = qemu_opt_get_number(opts, "maxcpus", 0); + max_cpus = max_cpus ?: cpus; + + if (sockets * cores * threads != max_cpus) { + fprintf(stderr, "cpu topology: warning: " + "sockets (%u) * cores (%u) * threads (%u) != max_cpus (%u)\n", + sockets, cores, threads, max_cpus); + } smp_cpus = cpus; smp_cores = cores;