Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LrwT9-0002mP-Nz for qemu-devel@nongnu.org; Thu, 09 Apr 2009 11:47:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LrwT5-0002iG-5a for qemu-devel@nongnu.org; Thu, 09 Apr 2009 11:47:11 -0400 Received: from [199.232.76.173] (port=51900 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LrwT4-0002i4-UE for qemu-devel@nongnu.org; Thu, 09 Apr 2009 11:47:06 -0400 Received: from lucius.provo.novell.com ([137.65.248.127]:41381) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LrwT4-0002Qc-Hu for qemu-devel@nongnu.org; Thu, 09 Apr 2009 11:47:06 -0400 Message-Id: <49DDC4160200004800071C73@lucius.provo.novell.com> Date: Thu, 09 Apr 2009 09:47:02 -0600 From: "Bruce Rogers" Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: [Qemu-devel] [PATCH] limit guest cpus for kvm enabled builds Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org The x86 kvm kernel module limits guest cpu count to 16, but the userspace = pc definition says 255 still. When invoking qemu-kvm with -smp > 16, it = prints some error messages, then segfaults. One of the mistakes is that = the error code from kvm_create_vcpu is ignored in ap_main_loop. This patch will enforce the limit at initialization time and avoid these = problems from the get go. Bruce Signed-off-by: Bruce Rogers --- a/hw/pc.c +++ b/hw/pc.c @@ -1162,7 +1162,11 @@ QEMUMachine pc_machine =3D { .desc =3D "Standard PC", .init =3D pc_init_pci, .ram_require =3D VGA_RAM_SIZE + PC_MAX_BIOS_SIZE, +#ifdef CONFIG_KVM + .max_cpus =3D 16, +#else .max_cpus =3D 255, +#endif };