qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: lcapitulino@redhat.com, Amos Kong <akong@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Ronen Hod <rhod@redhat.com>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] RFC: Full introspection support for QMP
Date: Thu, 23 May 2013 07:08:59 -0500	[thread overview]
Message-ID: <87a9nlx5ic.fsf@codemonkey.ws> (raw)
In-Reply-To: <20130523081837.GA3082@dhcp-200-207.str.redhat.com>

Kevin Wolf <kwolf@redhat.com> writes:

> Am 22.05.2013 um 18:14 hat Anthony Liguori geschrieben:
>> Kevin Wolf <kwolf@redhat.com> writes:
>> > For example, libvirt wants to query which block drivers it can use. It
>> > doesn't really matter for which drivers we had the source initially, but
>> > only which drivers are compiled in (possibly loaded) and can actually be
>> > used.
>> 
>> The schema is the wrong place to discover this.
>> 
>> Loading a module wouldn't add an enumeration value.  The enumeration
>> values are fixed.
>> 
>> We should introduce commands to query this kind of information.
>> 
>> Schema introspection is primarily useful for dynamic languages to
>> autogenerate bindings.  It's not terribly useful for query
>> capabilities/features.
>
> Then you won't get real modularity. It means that all modules must
> already be known during the build time, and if they aren't available
> (because they weren't built or aren't loaded) you include them anyway,
> some parts of them are a static part of the core. You don't get fully
> rid of modules by not linking their object file in, but you always have
> the QAPI part left over.

There are two things here: the schema and the generated code.  The
generated code can and should live in the module.

But the schema always stays the same.

Think of the schema like kernel headers.  The kernel headers are always
fixed regardless of what kernel modules are loaded or how the kernel is
configured.

> It also makes the schema totally useless. If you can't use it to tell
> which commands this qemu can execute and which it can't,

query-commands serves that purpose.

> then we don't need introspection at all. There's no user for it then.

Introspection is not the right approach to feature discovery.  The
schema does answer the question of what features are enabled, it just
answers the question of what the signature of the methods are.

> We can have hundreds of individual query commands like you suggest
> (query-qcow2-creation-option-values, yay!) or we do the modularity
> thing and the schema introspection properly and make it dynamic. I
> prefer the latter.

Let's consider a real example.  It sounds like you have something in
mind, can you be more specific?

Regards,

Anthony Liguori

>
> Kevin

  reply	other threads:[~2013-05-23 12:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22 13:40 [Qemu-devel] RFC: Full introspection support for QMP Amos Kong
2013-05-22 14:44 ` Kevin Wolf
2013-05-22 16:14   ` Anthony Liguori
2013-05-23  8:18     ` Kevin Wolf
2013-05-23 12:08       ` Anthony Liguori [this message]
2013-05-23 12:40         ` Luiz Capitulino
2013-05-23 12:52           ` Anthony Liguori
2013-05-23 12:54         ` Kevin Wolf
2013-05-23 13:52           ` Anthony Liguori
2013-05-23 14:17             ` Eric Blake
2013-05-23 14:29             ` Kevin Wolf
2013-05-22 17:56 ` Luiz Capitulino
2013-05-23 12:58 ` Eric Blake
2013-06-07 10:12 ` [Qemu-devel] RFC: Full introspection support for QMP (with draft patch) Amos Kong
2013-06-07 10:17   ` Amos Kong
2013-06-14  9:52     ` Amos Kong
2013-06-14 10:59       ` Eric Blake
2013-06-14 11:09       ` Eric Blake
2013-06-18 12:21         ` Amos Kong

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=87a9nlx5ic.fsf@codemonkey.ws \
    --to=aliguori@us.ibm.com \
    --cc=akong@redhat.com \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rhod@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 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).