qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/7] qdev: add description field in PropertyInfo


From: Gonglei
Subject: Re: [Qemu-devel] [PATCH 3/7] qdev: add description field in PropertyInfo struct
Date: Wed, 24 Sep 2014 21:56:49 +0800

> Subject: Re: [Qemu-devel] [PATCH 3/7] qdev: add description field in
> PropertyInfo struct
> 
> Il 23/09/2014 15:08, address@hidden ha scritto:
> > From: Gonglei <address@hidden>
> >
> > The descriptions can serve as documentation in the code,
> > and they can be used to provide better help.
> >
> > Cc: Paolo Bonzini <address@hidden>
> > Cc: Michael S. Tsirkin <address@hidden>
> > Cc: Markus Armbruster <address@hidden>
> > Signed-off-by: Gonglei <address@hidden>
> > ---
> >  hw/core/qdev-properties-system.c | 4 ++++
> >  hw/core/qdev-properties.c        | 6 ++++++
> >  include/hw/qdev-core.h           | 1 +
> >  target-ppc/translate_init.c      | 1 +
> >  4 files changed, 12 insertions(+)
> >
> > diff --git a/hw/core/qdev-properties-system.c
> b/hw/core/qdev-properties-system.c
> > index 84caa1d..4c8ea18 100644
> > --- a/hw/core/qdev-properties-system.c
> > +++ b/hw/core/qdev-properties-system.c
> > @@ -113,6 +113,7 @@ static void set_drive(Object *obj, Visitor *v, void
> *opaque,
> >  PropertyInfo qdev_prop_drive = {
> >      .name  = "str",
> >      .legacy_name  = "drive",
> > +    .description = "ID of a drive to use as a backend",
> >      .get   = get_drive,
> >      .set   = set_drive,
> >      .release = release_drive,
> > @@ -170,6 +171,7 @@ static void set_chr(Object *obj, Visitor *v, void
> *opaque,
> >  PropertyInfo qdev_prop_chr = {
> >      .name  = "str",
> >      .legacy_name  = "chr",
> > +    .description = "ID of a chardev to use as a backend",
> >      .get   = get_chr,
> >      .set   = set_chr,
> >      .release = release_chr,
> > @@ -249,6 +251,7 @@ static void set_netdev(Object *obj, Visitor *v, void
> *opaque,
> >  PropertyInfo qdev_prop_netdev = {
> >      .name  = "str",
> >      .legacy_name  = "netdev",
> > +    .description = "ID of a netdev to use as a backend",
> >      .get   = get_netdev,
> >      .set   = set_netdev,
> >  };
> > @@ -329,6 +332,7 @@ static void set_vlan(Object *obj, Visitor *v, void
> *opaque,
> >  PropertyInfo qdev_prop_vlan = {
> >      .name  = "int32",
> >      .legacy_name  = "vlan",
> > +    .description = "The value of vlan id",
> 
> Integer VLAN id to connect to
> 
> >      .print = print_vlan,
> >      .get   = get_vlan,
> >      .set   = set_vlan,
> > diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
> > index 66556d3..2f7e52b 100644
> > --- a/hw/core/qdev-properties.c
> > +++ b/hw/core/qdev-properties.c
> > @@ -121,6 +121,7 @@ static void prop_set_bit(Object *obj, Visitor *v, void
> *opaque,
> >  PropertyInfo qdev_prop_bit = {
> >      .name  = "bool",
> >      .legacy_name  = "on/off",
> > +    .description = "on/off",
> >      .get   = prop_get_bit,
> >      .set   = prop_set_bit,
> >  };
> > @@ -456,6 +457,7 @@ inval:
> >  PropertyInfo qdev_prop_macaddr = {
> >      .name  = "str",
> >      .legacy_name  = "macaddr",
> > +    .description = "Ethernet 6-byte MAC Address, format:
> AA:BB:CC:DD:EE:FF",
> 
> Perhaps replace "format: .." with "example: 52:54:00:12:34:56" which is
> also the default.
> 
> >      .get   = get_mac,
> >      .set   = set_mac,
> >  };
> > @@ -478,6 +480,7 @@
> QEMU_BUILD_BUG_ON(sizeof(BiosAtaTranslation) != sizeof(int));
> >  PropertyInfo qdev_prop_bios_chs_trans = {
> >      .name = "BiosAtaTranslation",
> >      .legacy_name = "bios-chs-trans",
> > +    .description = "Bios ata translation",
> 
> Logical CHS translation algorithm, auto/none/lba/large/rechs
> 
> >      .enum_table = BiosAtaTranslation_lookup,
> >      .get = get_enum,
> >      .set = set_enum,
> > @@ -552,6 +555,7 @@ static int print_pci_devfn(DeviceState *dev, Property
> *prop, char *dest,
> >  PropertyInfo qdev_prop_pci_devfn = {
> >      .name  = "int32",
> >      .legacy_name  = "pci-devfn",
> > +    .description = "The slot number of a pci device",
> 
> "Slot and function number, example: 06.0"
> 
> >      .print = print_pci_devfn,
> >      .get   = get_int32,
> >      .set   = set_pci_devfn,
> > @@ -599,6 +603,7 @@ static void set_blocksize(Object *obj, Visitor *v, void
> *opaque,
> >  PropertyInfo qdev_prop_blocksize = {
> >      .name  = "uint16",
> >      .legacy_name  = "blocksize",
> > +    .description = "A power of two between 512 and 32768",
> >      .get   = get_uint16,
> >      .set   = set_blocksize,
> >  };
> > @@ -707,6 +712,7 @@ inval:
> >  PropertyInfo qdev_prop_pci_host_devaddr = {
> >      .name = "str",
> >      .legacy_name = "pci-host-devaddr",
> > +    .description = "The bdf number of pci on host, such as: 04:10.0",
> 
> "Address (bus/device/function) of the host device, example: 04:10.0"
> 
> >      .get = get_pci_host_devaddr,
> >      .set = set_pci_host_devaddr,
> >  };
> > diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
> > index 178fee2..31acbe6 100644
> > --- a/include/hw/qdev-core.h
> > +++ b/include/hw/qdev-core.h
> > @@ -233,6 +233,7 @@ struct Property {
> >  struct PropertyInfo {
> >      const char *name;
> >      const char *legacy_name;
> > +    const char *description;
> >      const char **enum_table;
> >      int (*print)(DeviceState *dev, Property *prop, char *dest, size_t len);
> >      ObjectPropertyAccessor *get;
> > diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
> > index 48177ed..56a9f75 100644
> > --- a/target-ppc/translate_init.c
> > +++ b/target-ppc/translate_init.c
> > @@ -8045,6 +8045,7 @@ static void powerpc_set_compat(Object *obj,
> Visitor *v,
> >  static PropertyInfo powerpc_compat_propinfo = {
> >      .name = "str",
> >      .legacy_name = "powerpc-server-compat",
> > +    .description = "PowerPC server compat",
> 
> "compatibility mode, power6/power7/power8"
> 

OK, good. I will change them as your suggestion. 
v2 will cover those changes.  :)

Thanks a lot! Paolo.

Best regards,
-Gonglei





reply via email to

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