From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:37777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RuPVB-0001kD-IX for qemu-devel@nongnu.org; Mon, 06 Feb 2012 09:25:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RuPV5-0001S0-Kh for qemu-devel@nongnu.org; Mon, 06 Feb 2012 09:25:05 -0500 Received: from mail-pz0-f45.google.com ([209.85.210.45]:48671) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RuPV5-0001Rt-El for qemu-devel@nongnu.org; Mon, 06 Feb 2012 09:24:59 -0500 Received: by dadp14 with SMTP id p14so6482304dad.4 for ; Mon, 06 Feb 2012 06:24:58 -0800 (PST) Message-ID: <4F2FE2B7.6060905@codemonkey.ws> Date: Mon, 06 Feb 2012 08:24:55 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1328342577-25732-1-git-send-email-pbonzini@redhat.com> <1328342577-25732-12-git-send-email-pbonzini@redhat.com> In-Reply-To: <1328342577-25732-12-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 11/27] qom: fix canonical paths vs. interfaces List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On 02/04/2012 02:02 AM, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini Reviewed-by: Anthony Liguori Regards, Anthony Liguori > --- > qom/object.c | 10 ++++++++++ > 1 files changed, 10 insertions(+), 0 deletions(-) > > diff --git a/qom/object.c b/qom/object.c > index 75be582..e8418bc 100644 > --- a/qom/object.c > +++ b/qom/object.c > @@ -819,6 +819,12 @@ void object_property_add_child(Object *obj, const char *name, > { > gchar *type; > > + /* Registering an interface object in the composition tree will mightily > + * confuse object_get_canonical_path (which, on the other hand, knows how > + * to get the canonical path of an interface object). > + */ > + assert(!object_is_type(obj, type_interface)); > + > type = g_strdup_printf("child<%s>", object_get_typename(OBJECT(child))); > > object_property_add(obj, name, type, object_get_child_property, > @@ -912,6 +918,10 @@ gchar *object_get_canonical_path(Object *obj) > Object *root = object_get_root(); > char *newpath = NULL, *path = NULL; > > + if (object_is_type(obj, type_interface)) { > + obj = INTERFACE(obj)->obj; > + } > + > while (obj != root) { > ObjectProperty *prop = NULL; >