All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Mayer" <l_indien@magic.fr>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Patch] set boot sequence from command line
Date: Thu, 25 Oct 2007 00:15:45 +0200	[thread overview]
Message-ID: <1193264146.16781.247.camel@rapid> (raw)
In-Reply-To: <fb249edb0710241459m4c6943acl5e91e292cad2a2da@mail.gmail.com>


On Wed, 2007-10-24 at 23:59 +0200, andrzej zaborowski wrote:
> On 24/10/2007, Dan Kenigsberg <danken@qumranet.com> 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, <n> 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 <l_indien@magic.fr>
Never organized

  reply	other threads:[~2007-10-24 22:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-24  8:46 [Qemu-devel] [Patch] set boot sequence from command line Dan Kenigsberg
2007-10-24 21:17 ` Laurent Vivier
2007-10-24 21:41 ` Anthony Liguori
2007-10-24 21:46   ` Daniel P. Berrange
2007-10-24 21:59 ` andrzej zaborowski
2007-10-24 22:15   ` J. Mayer [this message]
2007-10-25  8:49 ` Bernhard Kauer
2007-10-25  9:35   ` [Qemu-devel] [Patch] set boot sequence from command line - Take 2 Dan Kenigsberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1193264146.16781.247.camel@rapid \
    --to=l_indien@magic.fr \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.