qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3 0/7] add description field in ObjectProperty and PropertyInfo struct
@ 2014-09-27  5:13 arei.gonglei
  2014-09-27  5:13 ` [Qemu-devel] [PATCH v3 1/7] qom: add error handler for object_property_print() arei.gonglei
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: arei.gonglei @ 2014-09-27  5:13 UTC (permalink / raw)
  To: qemu-devel
  Cc: weidong.huang, aliguori, mst, armbru, luonengjun, peter.huangpeng,
	lcapitulino, Gonglei, stefanha, pbonzini, afaerber

From: Gonglei <arei.gonglei@huawei.com>

ATCH 1 and PATCH 2 are bugfixes. PATCH 3~7 add a description
field in both ObjectProperty and PropertyInfo struct.
The descriptions can serve as documentation in the code,
and they can be used to provide better help. For example:

Before this patch series:

$./qemu-system-x86_64 -device virtio-blk-pci,?

virtio-blk-pci.iothread=link<iothread>
virtio-blk-pci.x-data-plane=bool
virtio-blk-pci.scsi=bool
virtio-blk-pci.config-wce=bool
virtio-blk-pci.serial=str
virtio-blk-pci.secs=uint32
virtio-blk-pci.heads=uint32
virtio-blk-pci.cyls=uint32
virtio-blk-pci.discard_granularity=uint32
virtio-blk-pci.bootindex=int32
virtio-blk-pci.opt_io_size=uint32
virtio-blk-pci.min_io_size=uint16
virtio-blk-pci.physical_block_size=uint16
virtio-blk-pci.logical_block_size=uint16
virtio-blk-pci.drive=str
virtio-blk-pci.virtio-backend=child<virtio-blk-device>
virtio-blk-pci.command_serr_enable=on/off
virtio-blk-pci.multifunction=on/off
virtio-blk-pci.rombar=uint32
virtio-blk-pci.romfile=str
virtio-blk-pci.addr=pci-devfn
virtio-blk-pci.event_idx=on/off
virtio-blk-pci.indirect_desc=on/off
virtio-blk-pci.vectors=uint32
virtio-blk-pci.ioeventfd=on/off
virtio-blk-pci.class=uint32

After:

$./qemu-system-x86_64 -device virtio-blk-pci,?

virtio-blk-pci.iothread=link<iothread>
virtio-blk-pci.x-data-plane=bool (on/off)
virtio-blk-pci.scsi=bool (on/off)
virtio-blk-pci.config-wce=bool (on/off)
virtio-blk-pci.serial=str
virtio-blk-pci.secs=uint32
virtio-blk-pci.heads=uint32
virtio-blk-pci.cyls=uint32
virtio-blk-pci.discard_granularity=uint32
virtio-blk-pci.bootindex=int32
virtio-blk-pci.opt_io_size=uint32
virtio-blk-pci.min_io_size=uint16
virtio-blk-pci.physical_block_size=uint16 (A power of two between 512 and 32768)
virtio-blk-pci.logical_block_size=uint16 (A power of two between 512 and 32768)
virtio-blk-pci.drive=str (ID of a drive to use as a backend)
virtio-blk-pci.virtio-backend=child<virtio-blk-device>
virtio-blk-pci.command_serr_enable=bool (on/off)
virtio-blk-pci.multifunction=bool (on/off)
virtio-blk-pci.rombar=uint32
virtio-blk-pci.romfile=str
virtio-blk-pci.addr=int32 (Slot and function number, example: 06.0)
virtio-blk-pci.event_idx=bool (on/off)
virtio-blk-pci.indirect_desc=bool (on/off)
virtio-blk-pci.vectors=uint32
virtio-blk-pci.ioeventfd=bool (on/off)
virtio-blk-pci.class=uint32

v3 -> v2:
 1. add a new "description" field to DevicePropertyInfo, and format
    it in qdev_device_help() in PATCH 6 (Paolo)

v2 -> v1:
 1. rename "fail" label to "out" in PATCH 1 (Andreas)
 2. improve descriptions in PATCH 3 (Paolo, adding Signed-off-by Paolo in this patch)
 3. rework PATCH 5, set description at qdev_property_add_static(),
    then copy the description of target_obj.property. (Paolo)
 4. free description filed of ObjectProperty avoid memory leak in PATCH 4.

Thanks for review!

 Cc: Paolo Bonzini <pbonzini@redhat.com>
 Cc: Michael S. Tsirkin <mst@redhat.com>
 Cc: Markus Armbruster <armbru@redhat.com>


Gonglei (7):
  qom: add error handler for object_property_print()
  qom: add error handler for object alias property
  qdev: add description field in PropertyInfo struct
  qom: add description field in ObjectProperty struct
  qdev: set the object property's description to the qdev property's.
  qmp: print descriptions of object properties
  qdev: drop legacy_name from qdev properties

 hw/core/qdev-properties-system.c |  8 ++++----
 hw/core/qdev-properties.c        | 14 ++++++++------
 hw/core/qdev.c                   |  5 +++++
 include/hw/qdev-core.h           |  2 +-
 include/qom/object.h             | 15 +++++++++++++++
 qapi-schema.json                 |  3 ++-
 qdev-monitor.c                   |  7 ++++++-
 qmp.c                            | 12 +++++++++---
 qom/object.c                     | 39 ++++++++++++++++++++++++++++++++++++---
 target-ppc/translate_init.c      |  2 +-
 10 files changed, 87 insertions(+), 20 deletions(-)

-- 
1.7.12.4

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-09-30  1:50 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-27  5:13 [Qemu-devel] [PATCH v3 0/7] add description field in ObjectProperty and PropertyInfo struct arei.gonglei
2014-09-27  5:13 ` [Qemu-devel] [PATCH v3 1/7] qom: add error handler for object_property_print() arei.gonglei
2014-09-27  5:13 ` [Qemu-devel] [PATCH v3 2/7] qom: add error handler for object alias property arei.gonglei
2014-09-27  5:13 ` [Qemu-devel] [PATCH v3 3/7] qdev: add description field in PropertyInfo struct arei.gonglei
2014-09-27  5:13 ` [Qemu-devel] [PATCH v3 4/7] qom: add description field in ObjectProperty struct arei.gonglei
2014-09-29 13:35   ` Paolo Bonzini
2014-09-30  1:45     ` Gonglei (Arei)
2014-09-27  5:13 ` [Qemu-devel] [PATCH v3 5/7] qdev: set the object property's description to the qdev property's arei.gonglei
2014-09-27  5:14 ` [Qemu-devel] [PATCH v3 6/7] qmp: print descriptions of object properties arei.gonglei
2014-09-29 16:27   ` Eric Blake
2014-09-30  1:49     ` Gonglei (Arei)
2014-09-27  5:14 ` [Qemu-devel] [PATCH v3 7/7] qdev: drop legacy_name from qdev properties arei.gonglei
2014-09-29 15:15 ` [Qemu-devel] [PATCH v3 0/7] add description field in ObjectProperty and PropertyInfo struct Andreas Färber
2014-09-30  0:58   ` Gonglei (Arei)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).