Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MtWMx-0008CJ-JG for qemu-devel@nongnu.org; Thu, 01 Oct 2009 20:51:35 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtWMs-00089S-Vh for qemu-devel@nongnu.org; Thu, 01 Oct 2009 20:51:35 -0400 Received: from [199.232.76.173] (port=51342 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtWMs-00089P-TA for qemu-devel@nongnu.org; Thu, 01 Oct 2009 20:51:30 -0400 Received: from imta-38.everyone.net ([216.200.145.38]:58993 helo=omta0104.mta.everyone.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MtWMs-00053T-E6 for qemu-devel@nongnu.org; Thu, 01 Oct 2009 20:51:30 -0400 Date: Thu, 1 Oct 2009 20:51:27 -0400 From: Kevin O'Connor Message-ID: <20091002005127.GA4835@morn.localdomain> References: <20090914125141.GB30746@redhat.com> <20090915000824.GA16210@morn.localdomain> <20091001163555.GV9832@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091001163555.GV9832@redhat.com> Subject: [Qemu-devel] Re: [PATCH][SEABIOS] Move qemu config port access functions into separate file. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov Cc: qemu-devel@nongnu.org On Thu, Oct 01, 2009 at 06:35:55PM +0200, Gleb Natapov wrote: > > As an aside, it would be good to have a conversation on general BIOS > > configuration options. These types of settings are going to be useful > > on real hardware also - it would be nice to come up with a scheme that > > would work on qemu and coreboot. Maybe something like > > get_config_u32("ShowBootMenu") - where on qemu it would get the info > > from the qemu port but on coreboot it would pull the setting from the > > coreboot flash filesystem. > > > I started to implement this approach, but found a serious disadvantage: > What if config option is not known to qemu or coreboot? What is it > present only in qemu and meaningful default behaviour is required > for coreboot? Like ShowBootMenu for instance. We want to return qemu > setting or coreboot setting or 1 if neither is present. I think passing in a default parameter like: get_config_u32("ShowBootMenu", 1) would work (return the config value or "1" if not found). [...] > --- /dev/null > +++ b/src/cbcfg.c > @@ -0,0 +1,13 @@ > +#include "config.h" > +#include "util.h" > +#include "cfg.h" > + > +void cfg_get_uuid(u8 *uuid) > +{ > + memset(uuid, 0, 16); > +} > + > +int cfg_show_boot_menu(void) > +{ > + return 1; > +} What this would end up looking like is: int cfg_show_boot_menu(void) { return get_cbfs_config_u32("ShowBootMenu", 1); } Having to write these wrapper functions is tedious, which is why it would be nice if I could get a name/value pair directly from qemu. If qemu can provide a "stream" with a text config file in it, that's okay too. Basically, that's what I'm thinking of doing on coreboot. Something like: =============================== ShowBootMenu=1 BootMenuDelayMS=5000 ATA1-0-translation=2 DefaultBootDevice=2 =============================== -Kevin