All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Osier Yang <jyang@redhat.com>,
	laine@redhat.com, libvir-list@redhat.com, rjones@redhat.com,
	qemu-devel <qemu-devel@nongnu.org>,
	anthony@codemonkey.ws, Luiz Capitulino <lcapitulino@redhat.com>,
	Amos Kong <akong@redhat.com>
Subject: Re: [Qemu-devel] fix/re-do query-command-line-options
Date: Tue, 28 Jan 2014 14:35:35 +0100	[thread overview]
Message-ID: <52E7B227.2060408@redhat.com> (raw)
In-Reply-To: <8761p4gsbk.fsf@blackfin.pond.sub.org>

Il 28/01/2014 14:16, Markus Armbruster ha scritto:
>>> That would mean we can't ever add an option that doesn't take an
>>> argument again.
>>
>> We can add it under an existing QemuOpts group or invent a new one
>> (like we did for -rt or -msg).
>
> Do you mean -rtc?

I meant -rt, but -rtc applies just as well. :)

> -msg takes a timestamp=on/off argument.  I guess that doesn't feel too
> forced, because we could conceivably have more settings related to error
> reporting.
>
> Do you mean to suggest new options should always be done in a way that
> makes them fit into QemuOpts?

Yes.  Not into *existing* QemuOpts of course.

> How would you add something like -S, -nodefaults, or -daemonize?

I would add -nodefaults and -S to -machine.  I would deprecate 
-daemonize.  But that's just for the sake of -readconfig.  Consumers of 
introspection can just "know" that those options are there.

> The question is whether we should extend QemuOpts to cover options
> without arguments, or change the options without arguments to fit into
> existing QemuOpts, e.g. by making them all syntactic sugar for a
> suitable QemuOpts-style option.
>
> If we do the latter, we need to tell customers of command line
> introspection to look only for the desugared forms.

Yeah.

>>>> (b) document the QemuOpts schema for -acpitable, -smbios, -netdev,
>>>> -net. These options validate the options with OptsVisitor, so we could
>>>> do without QemuOpts schema, but we know the schema won't bitrot
>>>> because we never remove suboptions.
>>>
>>> -device?
>>
>> -device already provides its own introspection via "qom-list-types"
>> and "-device driver,?".
>
> We're discussing introspection via QMP, so "-device driver,help" doesn't
> count.
>
> qom-list-types with argument "implements": "device" together with
> device-list-properties indeed lets you introspect device models and
> their properties.  You then need to to know how to translate that to
> the command line.  For instance, you need to know that "type": "on/off"
> in the former means "type": "boolean" in the latter, and so forth.

Yes.  That's what I actually meant.  O:-)

> What I'd like to see is more unified introspection, not this smattering
> of one-offs hacked up without too much thought to serve some immediate
> need we have now.
>
> We already have something that aspires to be our unified interface
> description: QAPI schemata.  Perhaps we should make it our unified
> introspection mechanism while we're at it.

QOM introspection can use QAPI schemata.  Property types should be one of:

* child<ClassName>

* link<ClassName>

* QAPI scalar type

* QAPI compound type

I see QOM introspection as orthogonal to QAPI introspection, and 
QemuOpts introspection as complementary to both:

        command line introspection        QMP introspection
          |                    |            |        |
          |                    v            |        |
          v           QOM introspection  <--'        |
       QemuOpts                |                     |
     introspection             v                     |
                     QAPI introspection  <-----------'

Makes any sense? :)

>>>> (b) documenting the schemata is not harder than what Amos proposed.
>>>>
>>>> (c) schema inspection for objects remains a problem, but one that we
>>>> need to solve anyway so it doesn't affect query-command-line-options.
>>>
>>> As long as we don't have such schema inspection, I'm rather reluctant to
>>> reject alternative means to solve problems people have *now*.
>>
>> Note the "doesn't affect query-command-line-options" part.  Amos's
>> patch do not solve the problem of which classes can be instantiated
>> with -object, or of which properties can be used.
>
> Possible misunderstanding on my part.  I was afraid you were arguing to
> solve -object introspection *instead* of Amos's incremental improvement,
> but that doesn't seem to be the case.

Well, I was arguing against this series.  I think it provides little 
benefit and has a comparatively high cost in terms of future backwards 
compatibility.

I was arguing for ignoring non-QemuOpts options and focus on what really 
matters, which is QemuOpts, QOM and QAPI introspection.  The first is 
already there and can be fixed by adding schemata for -acpitable and 
friends.  QAPI introspection is already being tackled by Amos.

QOM/-object is indeed the elephant in the room, but luckily we have 
enough few users that I believe we can do it if we agree on the right 
design.

Paolo

  reply	other threads:[~2014-01-28 13:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-23  2:19 [Qemu-devel] fix/re-do query-command-line-options Amos Kong
2014-01-27 10:24 ` [Qemu-devel] [resend] " Amos Kong
2014-01-27 16:27 ` [Qemu-devel] " Eric Blake
2014-01-28  9:36 ` Markus Armbruster
2014-01-28 10:01   ` Paolo Bonzini
2014-01-28 11:55     ` Markus Armbruster
2014-01-28 12:05       ` Paolo Bonzini
2014-01-28 13:16         ` Markus Armbruster
2014-01-28 13:35           ` Paolo Bonzini [this message]
2014-01-28 14:28             ` Markus Armbruster
2014-01-28 15:33               ` Paolo Bonzini

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=52E7B227.2060408@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=akong@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=armbru@redhat.com \
    --cc=jyang@redhat.com \
    --cc=laine@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rjones@redhat.com \
    /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.