From: Paolo Bonzini <pbonzini@redhat.com>
To: Alexander Barabash <alexander_barabash@mentor.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] Add object_property_get_child().
Date: Mon, 20 Feb 2012 10:11:25 +0100 [thread overview]
Message-ID: <4F420E3D.40307@redhat.com> (raw)
In-Reply-To: <4F40ECC6.8000603@mentor.com>
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
next prev parent reply other threads:[~2012-02-20 9:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-16 17:39 [Qemu-devel] [PATCH] Add object_property_get_child() Alexander Barabash
2012-02-16 18:16 ` Peter Maydell
2012-02-17 10:17 ` Paolo Bonzini
2012-02-19 12:36 ` Alexander Barabash
2012-02-19 16:04 ` [Qemu-devel] [PATCH v2] Revised: " Alexander Barabash
2012-02-19 17:14 ` Andreas Färber
2012-02-19 18:30 ` Peter Maydell
2012-02-20 15:06 ` Alexander Barabash
2012-02-20 11:14 ` Alexander Barabash
2012-02-20 9:11 ` Paolo Bonzini [this message]
2012-02-20 11:13 ` [Qemu-devel] [PATCH] " Alexander Barabash
2012-02-20 11: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=4F420E3D.40307@redhat.com \
--to=pbonzini@redhat.com \
--cc=alexander_barabash@mentor.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).