All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/7] vl: New qemu_get_machine_opts()
Date: Thu, 04 Jul 2013 18:11:45 +0200	[thread overview]
Message-ID: <87r4fepany.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <CAFEAcA_Mv6K3D8Z++zmrk6eHCgB5cQpi-Fm1k5dPrdMVzYdE+Q@mail.gmail.com> (Peter Maydell's message of "Thu, 4 Jul 2013 16:11:08 +0100")

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

> On 4 July 2013 16:03, Markus Armbruster <armbru@redhat.com> wrote:
>> Peter Maydell <peter.maydell@linaro.org> writes:
>>> This looks a bit odd -- why are we creating new
>>> options in a function that claims to only be querying
>>> them?
>>
>> So we never return null.  If it bothers you, I can initialize the
>> options to empty somewhere else, and assert they exist here.
>
> The other option would be to modify qemu_opt_get and
> friends to accept a NULL QemuOpts* as meaning "return
> the default".

I considered it, but it's more involved, and it'll sweep accidental null
opts arguments under the carpet (not sure that's worth worrying about).

>               That seems cleaner to me than having
> "machine" opts be a special case.

"machine" opts are a special case, because unlike most options, they're
a singleton.

Anyway, what do you guys want me to do?

(1) Create empty machine options on the fly (this is what the current
patch does)

(2) Initialize machine options elsewhere

(3) Make QemuOpts consistently treat NULL like empty options (possibly
quite some work)

I don't mind (1) or (2), but (3) feels like a bit more than I bargained
for.  I just want to fix the bug that bit me, not rework QemuOpts.

  reply	other threads:[~2013-07-04 16:11 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-04 13:09 [Qemu-devel] [PATCH 0/7] Fixes around -machine Markus Armbruster
2013-07-04 13:09 ` [Qemu-devel] [PATCH 1/7] qemu-option: Fix qemu_opts_find() for null id arguments Markus Armbruster
2013-07-04 14:40   ` Peter Maydell
2013-07-04 13:09 ` [Qemu-devel] [PATCH 2/7] qemu-option: Fix qemu_opts_set_defaults() for corner cases Markus Armbruster
2013-07-04 14:34   ` Peter Maydell
2013-07-04 15:28     ` Markus Armbruster
2013-07-04 15:53       ` Peter Maydell
2013-07-04 13:09 ` [Qemu-devel] [PATCH 3/7] vl: New qemu_get_machine_opts() Markus Armbruster
2013-07-04 14:38   ` Peter Maydell
2013-07-04 15:03     ` Markus Armbruster
2013-07-04 15:11       ` Peter Maydell
2013-07-04 16:11         ` Markus Armbruster [this message]
2013-07-04 16:46           ` Peter Maydell
2013-07-04 15:14     ` Andreas Färber
2013-07-04 13:09 ` [Qemu-devel] [PATCH 4/7] Fix -machine options accel, kernel_irqchip, kvm_shadow_mem Markus Armbruster
2013-07-04 14:42   ` Peter Maydell
2013-07-04 15:58     ` Markus Armbruster
2013-07-04 16:03       ` Peter Maydell
2013-07-04 16:50         ` Markus Armbruster
2013-07-04 13:09 ` [Qemu-devel] [PATCH 5/7] microblaze: Fix latent bug with default DTB lookup Markus Armbruster
2013-07-10  3:05   ` Peter Crosthwaite
2013-07-04 13:09 ` [Qemu-devel] [PATCH 6/7] Simplify -machine option queries with qemu_get_machine_opts() Markus Armbruster
2013-07-04 13:09 ` [Qemu-devel] [PATCH 7/7] vl: Tighten parsing of -machine option phandle_start Markus Armbruster
2013-07-04 13:31   ` Alexander Graf
2013-07-04 15:01     ` Markus Armbruster
2013-07-04 23:21       ` Alexander Graf
2013-07-10 19:33 ` [Qemu-devel] [PATCH 0/7] Fixes around -machine Anthony Liguori
2013-07-11  6:45   ` Markus Armbruster

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=87r4fepany.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=peter.maydell@linaro.org \
    --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.