From: "Andreas Färber" <afaerber@suse.de>
To: "Daniel P. Berrange" <berrange@redhat.com>,
Markus Armbruster <armbru@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH RFC 1/7] qom: allow properties to be registered against classes
Date: Thu, 3 Sep 2015 19:21:07 +0200 [thread overview]
Message-ID: <55E88183.1010706@suse.de> (raw)
In-Reply-To: <20150903170914.GX31547@redhat.com>
Am 03.09.2015 um 19:09 schrieb Daniel P. Berrange:
> On Thu, Sep 03, 2015 at 07:02:25PM +0200, Markus Armbruster wrote:
>> Andreas Färber <afaerber@suse.de> writes:
>>
>>> Am 03.09.2015 um 18:37 schrieb Markus Armbruster:
>>>> "Daniel P. Berrange" <berrange@redhat.com> writes:
>>>>> On Wed, Sep 02, 2015 at 06:18:28PM +0200, Andreas Färber wrote:
>>>>>> I had suggested exactly this looong time ago, but Anthony opposed it. I
>>>>>> don't quite remember why...
>>>>>
>>>>> It is a while back now so I don't remember all aspects of the discussion
>>>>> either. The main thing I remember is that we could not simply use the
>>>>> existing GObject model from glib, since that exclusively records properties
>>>>> against the object class. In some cases, particularly the relationships
>>>>> between objects, QEMU needed to be able to define properties on the fly
>>>>> against object instances.
>>>>
>>>> I remember Anthony's assertion that this is the case, but I don't
>>>> remember the actual problems where this is actually the case.
>>>>
>>>> What properties do we currently define that could not be defined against
>>>> the class?
>>>
>>> All child<> properties and everything on Container objects.
>>
>> Apologies if you had to explain this a dozen times already, but here
>> goes my ignorant question anyway: why can't these properties be defined
>> against the class?
>
> IIUC, you can have zero or more "child<N>" properties registered.
> You only know how many such properties to register at runtime,
> and the count can vary per object instance. So you have to
> register "child<1>", "child<2>", etc properties on objects.
>
> If we wanted to register these against the class, we could
> introduce an "array of objects" property type. So we would
> just register a "children" array property against the class,
> which can be populated with arbitrary number of objects at
> runtime. If we did this though, we'd probably need to setup
> some backwards compat support so that any code (or external
> user of QEMU) that tries to use "child<1>" would get transparently
> forwarded to "children" property, element 1.
For that array concept I reserved literal "[*]" recently (patches welcome!),
> I think it could be worth exploring this idea,
but here child<...> is the type. Properties can have arbitrary names, in
some cases (containers) varying from instance to instance, thus are
dynamic. E.g., -device => /machine/peripheral-anon/device[n].
The peculiarity of child<> properties is that the property itself
contains the value pointer, rather than its parent object instance.
Therefore we'll need both class and object level properties, as I
thought you had done in your patch.
Markus, if we need an in-depth discussion, please put it on the agenda
for Tuesday. :)
Regards,
Andreas
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton; HRB 21284 (AG Nürnberg)
next prev parent reply other threads:[~2015-09-03 17:21 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-26 12:03 [Qemu-devel] [PATCH RFC 0/7] Making QOM introspectable Daniel P. Berrange
2015-08-26 12:03 ` [Qemu-devel] [PATCH RFC 1/7] qom: allow properties to be registered against classes Daniel P. Berrange
2015-09-02 16:18 ` Andreas Färber
2015-09-03 15:49 ` Daniel P. Berrange
2015-09-03 16:37 ` Markus Armbruster
2015-09-03 16:41 ` Andreas Färber
2015-09-03 17:02 ` Markus Armbruster
2015-09-03 17:09 ` Daniel P. Berrange
2015-09-03 17:21 ` Andreas Färber [this message]
2015-09-03 17:25 ` Daniel P. Berrange
2015-09-04 6:56 ` Markus Armbruster
2015-09-07 12:54 ` Paolo Bonzini
2015-09-11 16:09 ` Daniel P. Berrange
2015-09-04 21:38 ` Marc-André Lureau
2015-09-07 8:46 ` Daniel P. Berrange
2015-09-07 13:11 ` Andreas Färber
2015-09-07 13:17 ` Daniel P. Berrange
2015-08-26 12:03 ` [Qemu-devel] [PATCH RFC 2/7] hostmem: register properties against the class instead of object Daniel P. Berrange
2015-08-26 12:03 ` [Qemu-devel] [PATCH RFC 3/7] rng: " Daniel P. Berrange
2015-08-26 12:03 ` [Qemu-devel] [PATCH RFC 4/7] tpm: " Daniel P. Berrange
2015-08-26 12:03 ` [Qemu-devel] [PATCH RFC 5/7] cpu: avoid using object instance state in property getter Daniel P. Berrange
2015-08-26 12:03 ` [Qemu-devel] [PATCH RFC 6/7] x86-cpu: register properties against the class instead of object Daniel P. Berrange
2015-08-26 12:03 ` [Qemu-devel] [PATCH RFC 7/7] machine: " Daniel P. Berrange
2015-09-02 9:05 ` [Qemu-devel] [PATCH RFC 0/7] Making QOM introspectable Daniel P. Berrange
2015-09-02 11:14 ` Markus Armbruster
2015-09-02 16:16 ` Andreas Färber
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=55E88183.1010706@suse.de \
--to=afaerber@suse.de \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=pbonzini@redhat.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).