From: Paolo Bonzini <pbonzini@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, Michael Roth <mdroth@linux.vnet.ibm.com>,
Luiz Capitulino <lcapitulino@redhat.com>,
Anthony Liguori <aliguori@amazon.com>,
imammedo@redhat.com, akong@redhat.com
Subject: Re: [Qemu-devel] [PATCH 4/5] monitor: add object-add (QMP) and object_add (HMP) command
Date: Tue, 07 Jan 2014 13:51:49 +0100 [thread overview]
Message-ID: <52CBF865.7090708@redhat.com> (raw)
In-Reply-To: <87bnzoxaqu.fsf@blackfin.pond.sub.org>
Il 07/01/2014 13:00, Markus Armbruster ha scritto:
>> >
>> > Is dumping static properties based on class name sufficient, or do we
>> > need introspection for dynamic properties as well? (or are those not
>> > exposed outside of qom-set?)
>
> Can't say whether introspection limited to static properties would be
> useful, because I don't actually know how static and dynamic properties
> are used.
I think right now dynamic properties are used little-to-nothing.
They are used by non-devices such as the RNG backends, and for links
(which should replace PROP_PTR).
> I challenged the need for dynamic properties in the early QOM days,
> because they lead to dynamic schemata and complicate introspection, but
> Anthony assured us we cannot do without them.
Dynamic properties are the basis of the QOM tree *as it is implemented
now*. Children are simply dynamic properties of type child<SomeType>,
and they must be dynamic since the command-line influences the QOM tree.
So I agree with Anthony that dynamic properties are fundamental to the
way QOM is implemented. I'm not sure it is *necessary* for it to be
implemented that way, but I don't have any code to show that another
implementation would be simpler or better or even possible.
I also agree with him that moving the qdev properties code up to Object
is not the right way to proceed in order to have static properties.
That code has support for legacy property types such as hexadecimal,
that we need not have outside -device (i.e. if we can create devices one
day with -object, you'll have to write 0x402 because 402 will always be
interpreted as decimal). At the same time it does not support neither
links nor the more flexible getters/setters that QOM allows. We
probably would want this for QOM static properties.
On the other hand I agree with a large subset of your idea, i.e. that
devices should have a known schema for the subset of properties that can
be set at initialization time. Furthermore, this schema should be
introspectable.
Anyhow, with so little use of dynamic properties (outside children), I
believe no one can argue his position successfully with code rather than
just theories.
> > We could maybe introduce a QAPI 'built-in'
> > such as 'ObjectProperties' that automatically does the query based on the
> > now-special 'type' param and handles all the type-checking up-front. This
> > would avoid an open-ended 'dict' type proliferating too much and provide
> > infrastructure for introspection.
>
> I'm afraid I'm too ignorant to understand what you're proposing.
I don't really understand that either.
Paolo
next prev parent reply other threads:[~2014-01-07 12:52 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-10 17:00 [Qemu-devel] [PATCH 0/5] Monitor commands for object-add/del Paolo Bonzini
2013-12-10 17:00 ` [Qemu-devel] [PATCH 1/5] rng: initialize file descriptor to -1 Paolo Bonzini
2013-12-11 23:14 ` Eric Blake
2013-12-10 17:00 ` [Qemu-devel] [PATCH 2/5] qom: fix leak for objects created with -object Paolo Bonzini
2013-12-11 23:15 ` Eric Blake
2013-12-10 17:00 ` [Qemu-devel] [PATCH 3/5] qom: catch errors in object_property_add_child Paolo Bonzini
2013-12-11 23:16 ` Eric Blake
2013-12-10 17:00 ` [Qemu-devel] [PATCH 4/5] monitor: add object-add (QMP) and object_add (HMP) command Paolo Bonzini
2013-12-10 18:00 ` Eric Blake
2013-12-10 18:15 ` Paolo Bonzini
2013-12-13 2:55 ` Wenchao Xia
2013-12-13 12:19 ` Paolo Bonzini
2013-12-16 20:02 ` Luiz Capitulino
2013-12-17 7:20 ` Markus Armbruster
2013-12-19 21:53 ` Michael Roth
2014-01-07 12:00 ` Markus Armbruster
2014-01-07 12:51 ` Paolo Bonzini [this message]
2013-12-10 17:00 ` [Qemu-devel] [PATCH 5/5] monitor: add object-del (QMP) and object_del " Paolo Bonzini
2013-12-10 18:01 ` Eric Blake
2013-12-10 18:17 ` Paolo Bonzini
2013-12-12 15:43 ` [Qemu-devel] [PATCH 0/5] Monitor commands for object-add/del Igor Mammedov
2013-12-16 20:03 ` Luiz Capitulino
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=52CBF865.7090708@redhat.com \
--to=pbonzini@redhat.com \
--cc=akong@redhat.com \
--cc=aliguori@amazon.com \
--cc=armbru@redhat.com \
--cc=imammedo@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--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 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).