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 From: Andrew Jones 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> Subject: [Qemu-devel] [PATCH 3/3] vl: warn on topology <-> maxcpus mismatch List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, ehabkost@redhat.com 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; -- 1.9.3