From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46557) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWLdv-0000ah-JJ for qemu-devel@nongnu.org; Tue, 23 Sep 2014 04:40:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWLdm-0004U7-8k for qemu-devel@nongnu.org; Tue, 23 Sep 2014 04:40:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51633) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWLdm-0004Iv-14 for qemu-devel@nongnu.org; Tue, 23 Sep 2014 04:40:06 -0400 Message-ID: <542131D1.8050806@redhat.com> Date: Tue, 23 Sep 2014 10:39:45 +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> <20140922123419.GA7992@redhat.com> <54201C35.1090502@redhat.com> <33183CC9F5247A488A2544077AF1902086DD991C@SZXEMA503-MBS.china.huawei.com> In-Reply-To: <33183CC9F5247A488A2544077AF1902086DD991C@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)" , "stefanha@redhat.com" , Markus Armbruster , "Huangpeng (Peter)" , "qemu-devel@nongnu.org" , "aliguori@amazon.com" , "lcapitulino@redhat.com" Il 23/09/2014 05:09, Gonglei (Arei) ha scritto: > Hi, > >>>>>> This doesn't change the fact that ObjectProperty is a generic struct, >>>>>> and adding alias-specific fields there is wrong. >>>>> >>>>> OK, Maybe I should find other ways to attach this purpose and >>>>> avoid layering violation. Thanks! >>>> >>>> Unfortunately I cannot think of any. >>>> >>>> We could add a description field to ObjectProperty, and replace >>>> legacy_name with a description. The output then would be >>>> >>>> virtio-blk.drive=str (drive) > > There is a question that the QOM properties are added dynamically. > When we call qdev_alias_all_properties() adding alias properties to > the source object all qdev properties on the target DeviceState, how do we > judge the property's name and set the value of corresponding description field? > Such as setting virtio-blk-pci.drive.description = "drive". You use the legacy_name field of PropertyInfo to set the description of a qdev property, and then let object_property_add_alias() copy the description. Paolo