Received: from eggs.gnu.org ([2001:4830:134:3::10]:43280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xmm1v-00079p-9F for qemu-devel@nongnu.org; Fri, 07 Nov 2014 11:05:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xmm1o-0003Zb-Lu for qemu-devel@nongnu.org; Fri, 07 Nov 2014 11:04:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37204) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xmm1o-0003ZX-Fd for qemu-devel@nongnu.org; Fri, 07 Nov 2014 11:04:48 -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 sA7G4lNv021643 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 7 Nov 2014 11:04:48 -0500 From: Andrew Jones Date: Fri, 7 Nov 2014 17:04:38 +0100 Message-Id: <1415376280-14130-2-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 1/3] vl: fix max_cpus check List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, ehabkost@redhat.com We should confirm max_cpus, which is >= smp_cpus, is <= the machine's true max_cpus, not just smp_cpus. Signed-off-by: Andrew Jones --- vl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vl.c b/vl.c index f4a6e5e05bce2..9d9855092ab4a 100644 --- a/vl.c +++ b/vl.c @@ -3903,9 +3903,9 @@ int main(int argc, char **argv, char **envp) smp_parse(qemu_opts_find(qemu_find_opts("smp-opts"), NULL)); machine_class->max_cpus = machine_class->max_cpus ?: 1; /* Default to UP */ - if (smp_cpus > machine_class->max_cpus) { + if (max_cpus > machine_class->max_cpus) { fprintf(stderr, "Number of SMP cpus requested (%d), exceeds max cpus " - "supported by machine `%s' (%d)\n", smp_cpus, + "supported by machine `%s' (%d)\n", max_cpus, machine_class->name, machine_class->max_cpus); exit(1); } -- 1.9.3