qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Add object_property_get_child().


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] Add object_property_get_child().
Date: Mon, 20 Feb 2012 10:11:25 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120209 Thunderbird/10.0.1

On 02/19/2012 01:36 PM, Alexander Barabash wrote:
> 
> 
> The proposed object_property_get_child() may return either
> the direct child with the specified name in the composition tree,
> or the value of the link with the specified name, as
> object_property_get_link() indeed does.

Have you actually checked that object_property_get_link() doesn't work
for you?  It seems to me that your patch does the same as the one-liner:

#define object_property_get_child object_property_get_link

Now _this_ would be good for qemu-trivial. ;)

> but does it in a more straightforward way. 

I disagree that it is more straightforward.  It is more *direct*
perhaps, in that it doesn't go through visitors,
object_get_child_property and object_resolve_path, but it also violates
the encapsulation that properties provide quite heavily.

Peeking at the opaque values of properties should be done as sparingly
as possible.  Ideally once, since no QOM property code should be in a
fast path.  In this case, it is done in object_resolve_abs_path, and
that should be enough.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]