From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kkh13-0008Co-Fb for qemu-devel@nongnu.org; Tue, 30 Sep 2008 11:19:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kkh0z-00086K-R9 for qemu-devel@nongnu.org; Tue, 30 Sep 2008 11:19:55 -0400 Received: from [199.232.76.173] (port=52995 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kkh0z-000863-Lu for qemu-devel@nongnu.org; Tue, 30 Sep 2008 11:19:53 -0400 Received: from mail-gx0-f19.google.com ([209.85.217.19]:37097) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kkh0z-0006hN-Hh for qemu-devel@nongnu.org; Tue, 30 Sep 2008 11:19:53 -0400 Received: by gxk12 with SMTP id 12so12840664gxk.10 for ; Tue, 30 Sep 2008 08:19:52 -0700 (PDT) Message-ID: <48E24359.9070607@codemonkey.ws> Date: Tue, 30 Sep 2008 10:18:49 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [patch] Introduce per machine based max_cpu variable References: <48D8D694.1000609@sgi.com> <200809231350.34178.paul@codesourcery.com> <48D8E6CA.9040802@sgi.com> <200809231404.49340.paul@codesourcery.com> <48DBAC61.9090906@sgi.com> <48E23C00.2030309@codemonkey.ws> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 Cc: Paul Brook Jes Sorensen wrote: >>> Index: qemu/hw/an5206.c >>> =================================================================== >>> --- qemu.orig/hw/an5206.c +++ qemu/hw/an5206.c @@ -88,8 +88,9 @@ >>> static void an5206_init(ram_addr_t ram_s } QEMUMachine >>> an5206_machine = { - "an5206", - "Arnewsh 5206", - an5206_init, - >>> 512, + .name = "an5206", + .desc = "Arnewsh 5206", + .init = >>> an5206_init, + .ram_require = 512, + .max_cpus = 1, }; >>> > > Anthony> Your change would be greatly simplified if you defined > Anthony> max_cpus to be such that it was the maximum number of vcpus - > Anthony> 1. > > Anthony> Then the default value of 0 would be sufficient for most > Anthony> machine types. > > Hi Anthony, > > I thought about this, but I think it's a really bad idea. It will > cause confusion over time and I think it is quite reasonable to > require all machines to define the maximum number of CPUs they > support. Thats why I defined the error message so it was quite easy > for anyone to fixup in case I got one of them wrong. > > I really think it's better to do this right than hack it. > If it were 'max_cpu' then the meaning is pretty clear. On a UP system, the max_cpu is 0. You could also make it max_aps which makes it even more clear. A UP system doesn't have any APs. The other option is to have max_cpus == 0 be equivalent to max_cpus == 1. But don't print anything. Basically, I don't like the idea of modifying every machine definition when they all have almost the exact same value for the field. Regards, Anthony Liguori