From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55544) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TSd7X-0003hP-43 for qemu-devel@nongnu.org; Sun, 28 Oct 2012 20:22:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TSd7W-0003Q5-1W for qemu-devel@nongnu.org; Sun, 28 Oct 2012 20:22:23 -0400 Received: from e23smtp02.au.ibm.com ([202.81.31.144]:47034) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TSd7V-0003Pi-DN for qemu-devel@nongnu.org; Sun, 28 Oct 2012 20:22:21 -0400 Received: from /spool/local by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 29 Oct 2012 10:19:22 +1000 Date: Mon, 29 Oct 2012 11:15:11 +1100 From: David Gibson Message-ID: <20121029001511.GC27695@truffula.fritz.box> References: <1351175895-27131-1-git-send-email-aviksil@linux.vnet.ibm.com> <1351175895-27131-2-git-send-email-aviksil@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 1/2] Make default boot order machine specific List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: aliguori@us.ibm.com, qemu-ppc@nongnu.org, Avik Sil , qemu-devel@nongnu.org On Thu, Oct 25, 2012 at 06:01:16PM +0100, Peter Maydell wrote: > On 25 October 2012 15:38, Avik Sil wrote: > > @@ -171,6 +171,7 @@ static QEMUMachine clipper_machine = { > > .init = clipper_init, > > .max_cpus = 4, > > .is_default = 1, > > + .default_machine_opts = DEFAULT_BOOT_ORDER, > > }; > > > @@ -86,6 +86,7 @@ static QEMUMachine an5206_machine = { > > .name = "an5206", > > .desc = "Arnewsh 5206", > > .init = an5206_init, > > + .default_machine_opts = DEFAULT_BOOT_ORDER, > > }; > > > +++ b/hw/axis_dev88.c > > @@ -355,6 +355,7 @@ static QEMUMachine axisdev88_machine = { > > .desc = "AXIS devboard 88", > > .init = axisdev88_init, > > .is_default = 1, > > + .default_machine_opts = DEFAULT_BOOT_ORDER, > > }; > > The thing about a default is that you shouldn't have to > explicitly say it in every QEMUMachine struct... Please > make the code handle a NULL in the struct in a way > that means you don't need to touch every board. So, simply treating NULL as equivalent to "cad" would defeat the purpose of this patch, which is to make a distinction visible to the machine between -boot not specified at all and -boot specified explicitly (as "cad" or otherwise). So that gives us a few options (Alex described 2 of these already): * Add a DEFAULT_MACHINE_OPTS macro which does this specification. Frankly I don't really see what that buys us above the DEFAULT_BOOT_ORDER that is already in the patch. * Add a 'use_default_boot_order' field to QEMUMachine. Avik actually did that in an earlier version and I convinced him the current approach would be better. Maybe that was a mistake. * Don't have the machines access the machine option directly, but via a helper macro which takes a default parameter. There's a patch from Li Zhang in Alex Graf's tree that does a similar thing for whether USB is enabled. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson