All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: "Huangweidong (C)" <weidong.huang@huawei.com>,
	"aliguori@amazon.com" <aliguori@amazon.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"agraf@suse.de" <agraf@suse.de>,
	"Huangpeng (Peter)" <peter.huangpeng@huawei.com>,
	"Gonglei (Arei)" <arei.gonglei@huawei.com>,
	"stefanha@redhat.com" <stefanha@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"lcapitulino@redhat.com" <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 0/3] Fix confused output for alias properties
Date: Tue, 23 Sep 2014 12:16:35 +0300	[thread overview]
Message-ID: <20140923091635.GA17562@redhat.com> (raw)
In-Reply-To: <87zjdqvh8l.fsf@blackfin.pond.sub.org>

On Tue, Sep 23, 2014 at 11:06:02AM +0200, Markus Armbruster wrote:
> "Gonglei (Arei)" <arei.gonglei@huawei.com> writes:
> 
> > 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".
> >
> > The only way I think of is using the property' name as the description. In 
> > object_property_add_alias() add below code:
> >
> > +   op->description = g_strdup(name);
> >
> > After those handling we can get results:
> >
> > virtio-blk-pci.physical_block_size=uint16 (physical_block_size)
> > virtio-blk-pci.logical_block_size=uint16 (logical_block_size)
> > virtio-blk-pci.drive=str (drive)
> >
> > virtio-net-pci.netdev=str (netdev)
> > virtio-net-pci.vlan=int (vlan)
> > virtio-net-pci.mac=str (mac)
> >
> > But if using this way, we just need simply modify make_device_property_info()
> > like below patch (just assure the new output resemble the old, don't need change
> > ObjectProperty struct).  Am I right? Thanks :)
> 
> Adding descriptions to properties is a big, but useful task.  The
> descriptions can serve as documentation in the code, and they can be
> used to provide better help.  This applies both to qdev and to object
> properties.
> 
> Completing this task in one go is unfortunately not practical.  We need
> to add descriptions incrementally.  Until we're done, some properties
> will lack descriptions (null pointer rather than a descriptive string).
> 
> Reusing the property name as description just to have a description adds
> no information.
> 
> What about this: add a description string (optional for now) both to
> ObjectProperty and to PropertyInfo.  Either add a description string
> parameter to object property constructors like object_property_add() and
> object_property_add_alias, or, for less churn, add a separate function
> to set an object property's description.  Update
> qdev_alias_all_properties() to set the object property's description to
> the qdev property's.
> 
> Then you can fix the help regression by giving all the regressed
> properties a useful description.
> 
> That fix should also permit retiring legacy_name.

Ack. Sounds good to me.

  reply	other threads:[~2014-09-23  9:13 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-15 14:44 [Qemu-devel] [PATCH 0/3] Fix confused output for alias properties arei.gonglei
2014-09-15 14:44 ` [Qemu-devel] [PATCH 1/3] qom: add error handler for object alias property arei.gonglei
2014-09-15 15:56   ` Paolo Bonzini
2014-09-15 14:44 ` [Qemu-devel] [PATCH 2/3] qom: add target object poniter for alias property in ObjectProperty arei.gonglei
2014-09-15 14:44 ` [Qemu-devel] [PATCH 3/3] qmp: print real legacy_name for alias property arei.gonglei
2014-09-15 17:46   ` Michael S. Tsirkin
2014-09-15 15:57 ` [Qemu-devel] [PATCH 0/3] Fix confused output for alias properties Paolo Bonzini
2014-09-15 17:38   ` Eric Blake
2014-09-15 17:45   ` Michael S. Tsirkin
2014-09-16  7:21     ` Markus Armbruster
2014-09-16  7:53       ` Gonglei (Arei)
2014-09-16  8:36       ` Paolo Bonzini
2014-09-16  9:16         ` Markus Armbruster
2014-09-16  9:34           ` Paolo Bonzini
2014-09-16 10:37             ` Michael S. Tsirkin
2014-09-16 10:45               ` Paolo Bonzini
2014-09-16 13:31                 ` Gonglei (Arei)
2014-09-16 16:26                 ` Michael S. Tsirkin
2014-09-16 16:27                   ` Paolo Bonzini
2014-09-16 16:56                     ` Michael S. Tsirkin
2014-09-16 18:31                       ` Paolo Bonzini
2014-09-16 19:01                         ` Michael S. Tsirkin
2014-09-16 19:01                           ` Michael S. Tsirkin
2014-09-17  6:02                             ` Markus Armbruster
2014-09-16 20:00                         ` Eric Blake
2014-09-17  5:54                           ` Markus Armbruster
2014-09-17 12:58                             ` Eric Blake
2014-09-16 14:32             ` Markus Armbruster
2014-09-16 14:36               ` Paolo Bonzini
2014-09-17  2:31                 ` Gonglei (Arei)
2014-09-22  8:26                 ` Gonglei (Arei)
2014-09-15 17:48 ` Michael S. Tsirkin
2014-09-15 17:49 ` Michael S. Tsirkin
2014-09-16  0:42   ` Gonglei (Arei)
2014-09-16  8:38   ` Paolo Bonzini
2014-09-22  8:34 ` Michael S. Tsirkin
2014-09-22  8:49   ` Gonglei (Arei)
2014-09-22  9:14   ` Paolo Bonzini
2014-09-22  9:33     ` Gonglei (Arei)
2014-09-22 10:03       ` Paolo Bonzini
2014-09-22 11:22         ` Gonglei (Arei)
2014-09-22 12:06           ` Paolo Bonzini
2014-09-22 12:34             ` Michael S. Tsirkin
2014-09-22 12:55               ` Paolo Bonzini
2014-09-23  3:09                 ` Gonglei (Arei)
2014-09-23  8:39                   ` Paolo Bonzini
2014-09-23  9:13                     ` Markus Armbruster
2014-09-23  9:18                     ` Gonglei (Arei)
2014-09-23  9:06                   ` Markus Armbruster
2014-09-23  9:16                     ` Michael S. Tsirkin [this message]
2014-09-23  9:17                     ` Gonglei (Arei)
2014-09-22 12:48             ` Markus Armbruster
2014-09-22 13:13             ` Gonglei (Arei)
2014-09-22 13:24               ` Paolo Bonzini
2014-09-22 13:36                 ` Gonglei (Arei)
2014-09-22 13:40                   ` Paolo Bonzini
2014-09-22 13:45                     ` Gonglei (Arei)
2014-09-22 13:19             ` Gonglei (Arei)
2014-09-22 11:43     ` Markus Armbruster
2014-09-22 13:08       ` Paolo Bonzini
2014-09-23  4:46         ` Michael S. Tsirkin
2014-09-23 11:39         ` Markus Armbruster
2014-09-22  9:29   ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140923091635.GA17562@redhat.com \
    --to=mst@redhat.com \
    --cc=agraf@suse.de \
    --cc=aliguori@amazon.com \
    --cc=arei.gonglei@huawei.com \
    --cc=armbru@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=weidong.huang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.