qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: Peter Maydell <peter.maydell@linaro.org>,
	Avik Sil <aviksil@linux.vnet.ibm.com>
Cc: david@gibson.dropbear.id.au, qemu-ppc@nongnu.org,
	qemu-devel@nongnu.org, agraf@suse.de
Subject: Re: [Qemu-devel] [PATCH v2 1/2] Make default boot order machine specific
Date: Thu, 25 Oct 2012 15:18:22 -0500	[thread overview]
Message-ID: <877gqetiep.fsf@codemonkey.ws> (raw)
In-Reply-To: <CAFEAcA9L9HrSo--S+uKkhJS=_g=15UmzOx4_A4Q4nc0vXQq1XA@mail.gmail.com>

Peter Maydell <peter.maydell@linaro.org> writes:

> On 25 October 2012 15:38, Avik Sil <aviksil@linux.vnet.ibm.com> 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.

I hate to spin a lot on a touch everything patch, but I also agree that
this is the wrong approach.

I think there are two reasonable approaches to this.  One would be a
macro to provide default initialization.  Something along the lines of:

#define DEFAULT_MACHINE_OPTIONS \
    .boot_order = "cad"

And then:

static QEMUMachine axisdev88_machine = {
    DEFAULT_MACHINE_OPTIONS,
    ...
};

static QEMUMachine pseries_machine = {
    DEFAULT_MACHINE_OPTIONS,
     /* no default boot order so we can detect absence of boot option */
    .boot_order = NULL,
};

Baking this into .default_machines_opts is too much overloading.

The other approach to this would be:

static QEMUMachine pseries_machine = {
    .no_boot_order = 1,
};

Which I think is what Peter is suggesting.  I'm not a huge fan of this
because it's backwards logic but we already do this for a bunch of other
things so I can't object too strongly to it.

Regards,

Anthony Liguori


>
> -- PMM

  reply	other threads:[~2012-10-25 20:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-25 14:38 [Qemu-devel] [PATCH v2 0/2] Qemu boot order patch series Avik Sil
2012-10-25 14:38 ` [Qemu-devel] [PATCH v2 1/2] Make default boot order machine specific Avik Sil
2012-10-25 17:01   ` Peter Maydell
2012-10-25 20:18     ` Anthony Liguori [this message]
2012-10-25 20:50       ` Peter Maydell
2012-10-25 20:57         ` Alexander Graf
2012-10-26 11:45           ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
2012-11-05 11:34             ` Avik Sil
2012-11-23 16:52               ` Alexander Graf
2012-11-27 17:24                 ` Avik Sil
2012-12-05 17:05             ` Avik Sil
2012-10-29  2:41         ` David Gibson
2012-10-29  0:15     ` David Gibson
2012-10-25 14:38 ` [Qemu-devel] [PATCH v2 2/2] pseries: set no default boot order Avik Sil
2012-10-25 16:49 ` [Qemu-devel] [PATCH v2 0/2] Qemu boot order patch series Alexander Graf

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=877gqetiep.fsf@codemonkey.ws \
    --to=aliguori@us.ibm.com \
    --cc=agraf@suse.de \
    --cc=aviksil@linux.vnet.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).