From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:48003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzPHW-0001OE-4x for qemu-devel@nongnu.org; Mon, 20 Feb 2012 04:11:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RzPHQ-0003sR-KD for qemu-devel@nongnu.org; Mon, 20 Feb 2012 04:11:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28517) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzPHQ-0003sF-BZ for qemu-devel@nongnu.org; Mon, 20 Feb 2012 04:11:32 -0500 Message-ID: <4F420E3D.40307@redhat.com> Date: Mon, 20 Feb 2012 10:11:25 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <4F3D3F67.9050506@mentor.com> <4F3E2945.3000603@redhat.com> <4F40ECC6.8000603@mentor.com> In-Reply-To: <4F40ECC6.8000603@mentor.com> Content-Type: text/plain; charset=ISO-8859-1 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: Alexander Barabash Cc: qemu-devel 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