From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XW3bc-0003ky-5b for qemu-devel@nongnu.org; Mon, 22 Sep 2014 09:24:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XW3bR-0004lN-V6 for qemu-devel@nongnu.org; Mon, 22 Sep 2014 09:24:40 -0400 Received: from mail-we0-x235.google.com ([2a00:1450:400c:c03::235]:54248) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XW3bR-0004kj-GJ for qemu-devel@nongnu.org; Mon, 22 Sep 2014 09:24:29 -0400 Received: by mail-we0-f181.google.com with SMTP id w61so1016908wes.26 for ; Mon, 22 Sep 2014 06:24:23 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <54202303.10409@redhat.com> Date: Mon, 22 Sep 2014 15:24:19 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1410792279-2488-1-git-send-email-arei.gonglei@huawei.com> <20140922083421.GA13006@redhat.com> <541FE889.3050209@redhat.com> <33183CC9F5247A488A2544077AF1902086DD90B3@SZXEMA503-MBS.china.huawei.com> <541FF3F9.5060705@redhat.com> <33183CC9F5247A488A2544077AF1902086DD915A@SZXEMA503-MBS.china.huawei.com> <542010CE.3010209@redhat.com> <33183CC9F5247A488A2544077AF1902086DD93BE@SZXEMA503-MBS.china.huawei.com> In-Reply-To: <33183CC9F5247A488A2544077AF1902086DD93BE@SZXEMA503-MBS.china.huawei.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/3] Fix confused output for alias properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Gonglei (Arei)" , "Michael S. Tsirkin" Cc: "agraf@suse.de" , "Huangweidong (C)" , "aliguori@amazon.com" , "Huangpeng (Peter)" , "qemu-devel@nongnu.org" , "stefanha@redhat.com" , "lcapitulino@redhat.com" Il 22/09/2014 15:13, Gonglei (Arei) ha scritto: > (I don't add alias-sepecific filed into ObjectProperty > struct, just add a bool property. ) > > diff --git a/include/qom/object.h b/include/qom/object.h > index 8a05a81..8b8ded5 100644 > --- a/include/qom/object.h > +++ b/include/qom/object.h > @@ -334,6 +334,11 @@ typedef void (ObjectPropertyRelease)(Object *obj, > const char *name, > void *opaque); > > +typedef struct { > + Object *target_obj; > + const char *target_name; > +} AliasProperty; > + > typedef struct ObjectProperty > { > gchar *name; > @@ -344,6 +349,8 @@ typedef struct ObjectProperty > ObjectPropertyRelease *release; > void *opaque; > > + bool is_alias; > + > QTAILQ_ENTRY(ObjectProperty) node; > } ObjectProperty; I don't think this is right. If the field is called "opaque", it's opaque. We already had cases where we were deriving the type of the opaque, and they caused bugs (though it was using the const char *type field; admittedly having a separate bool is a bit cleaner). Paolo