qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 0/5] add description field in ObjectProperty


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] [PATCH v4 0/5] add description field in ObjectProperty and PropertyInfo struct
Date: Tue, 30 Sep 2014 14:35:28 +0300

On Tue, Sep 30, 2014 at 11:02:34AM +0800, address@hidden wrote:
> From: Gonglei <address@hidden>
> 
> This patch series based on qom-next tree:
>  https://github.com/afaerber/qemu-cpu/commits/qom-next
> 
> 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)

Weird. 06.0 is clearly not an int, is it?

> 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

BTW, any way we can find out and report default values
as well? E.g.
virtio-blk-pci.indirect_desc=bool (on/off) default:on

This idea should not block this patch of course.

> v4 -> v3:
>  1. rebase on qom-next tree (Andreas)
>  2. fix memory leak in PATCH 2, move object_property_set_description calling
>     in object_property_add_alias() from PATCH 3 to PATCH 2. (Paolo)
>  3. drop "?:" in PATCH 2, call g_strdup() directly
>  4. rework PATCH 4, change description as optional field,
>     drop "?:" conditional express (Eric)
>  
> 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 <address@hidden>
>  Cc: Michael S. Tsirkin <address@hidden>
>  Cc: Markus Armbruster <address@hidden>
> 
> 
> Gonglei (5):
>   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                 |  4 +++-
>  qdev-monitor.c                   |  7 ++++++-
>  qmp.c                            | 13 ++++++++++---
>  qom/object.c                     | 20 ++++++++++++++++++++
>  target-ppc/translate_init.c      |  2 +-
>  10 files changed, 73 insertions(+), 17 deletions(-)
> 
> -- 
> 2.0.4
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]