From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzRBY-0002WM-Kn for qemu-devel@nongnu.org; Mon, 20 Feb 2012 06:13:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RzRBX-0002h2-Ga for qemu-devel@nongnu.org; Mon, 20 Feb 2012 06:13:36 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:36413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzRBX-0002gp-AO for qemu-devel@nongnu.org; Mon, 20 Feb 2012 06:13:35 -0500 Message-ID: <4F422AF3.2070807@mentor.com> Date: Mon, 20 Feb 2012 13:13:55 +0200 From: Alexander Barabash MIME-Version: 1.0 References: <4F3D3F67.9050506@mentor.com> <4F3E2945.3000603@redhat.com> <4F40ECC6.8000603@mentor.com> <4F420E3D.40307@redhat.com> In-Reply-To: <4F420E3D.40307@redhat.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Add object_property_get_child(). List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel On 02/20/2012 11:11 AM, Paolo Bonzini wrote: > 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. ;) You are right. Please disregard my v2 patch. I would only suggest that the documentation of object_property_add_child() be amended to reflect the fact that the child object may be retrieved using object_property_get_link(). >> 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 Alex