From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IkoW1-000444-G2 for qemu-devel@nongnu.org; Wed, 24 Oct 2007 18:15:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IkoVy-00043s-Sm for qemu-devel@nongnu.org; Wed, 24 Oct 2007 18:15:53 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IkoVy-00043p-MG for qemu-devel@nongnu.org; Wed, 24 Oct 2007 18:15:50 -0400 Received: from bangui.magic.fr ([195.154.194.245]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IkoVy-0000iL-9f for qemu-devel@nongnu.org; Wed, 24 Oct 2007 18:15:50 -0400 Received: from [192.168.0.2] (ppp-36.net-123.static.magiconline.fr [80.118.184.36]) by bangui.magic.fr (8.13.1/8.13.1) with ESMTP id l9OMFfpM029575 for ; Thu, 25 Oct 2007 00:15:41 +0200 Subject: Re: [Qemu-devel] [Patch] set boot sequence from command line From: "J. Mayer" In-Reply-To: References: <20071024084611.GA10261@karma.qumranet.com> Content-Type: text/plain Date: Thu, 25 Oct 2007 00:15:45 +0200 Message-Id: <1193264146.16781.247.camel@rapid> Mime-Version: 1.0 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 On Wed, 2007-10-24 at 23:59 +0200, andrzej zaborowski wrote: > On 24/10/2007, Dan Kenigsberg wrote: > > Real PCs try to boot from a CD, then try the hard drive, and finally go > > to the network. And they let their owner change that order. > > With the difference that on real PCs this is controlled by the BIOS > menu rather than a hardware switch, but the latter seems more > convenient for qemu. > > > This patch lets Qemu do the same with "-boot dcn". > > > > I'll be happy to hear comments about it, > > > > Dan. > > > > diff --git a/hw/an5206.c b/hw/an5206.c > > index 94ecccb..2134184 100644 > > --- a/hw/an5206.c > > +++ b/hw/an5206.c > > @@ -27,7 +27,7 @@ void DMA_run (void) > > > > /* Board init. */ > > > > -static void an5206_init(int ram_size, int vga_ram_size, int boot_device, > > +static void an5206_init(int ram_size, int vga_ram_size, char *boot_device, > > DisplayState *ds, const char **fd_filename, int snapshot, > > const char *kernel_filename, const char *kernel_cmdline, > > const char *initrd_filename, const char *cpu_model) > > BTW, it may be a good idea to pass all these values (maybe except ds) > as a single struct, for purely practical reasons. > Regards Maybe the use of several structure may be better: - one could be used to describe the kernel boot (with kernel_filename, kernel_cmdline, initrd_filename) and could be NULL - one for the hardware emulation parameters (ram_size, vga_ram_sze, cpu_model) - one for the emulation parameters if needed (snapshot, ds...) ... It may be more consistent than use a single structure melting misc stuff that are not directly related. One remark about the submited patch: why are the boot order table limited to 3 elements ? There are at least 4 choices available today (floppy, disk, CDROM, network) and maybe more in the future for some architecture (refering to the curently emulated hardware: 2 floppies, 4 IDE devices, network devices, SCSI storages, ...). I guess it's not a so good idea to override the boot_device table in the machine init routines. Imho, it would better be passed as a const char * argument. For the PowerPC part, there could be a local int boot_device variable that would be initialized to the first argument of the table. And this would not change the NVRAM initialisation API: if this API need to support more than one boot device in the future, it will have to be completelly reworked (for other reasons too), then I would suggest to be conservative and do not change this API at all. -- J. Mayer Never organized