qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] qdev: Clean up around properties
@ 2016-04-17  7:45 Cao jin
  2016-04-18  6:53 ` Markus Armbruster
  2016-05-10 12:52 ` Paolo Bonzini
  0 siblings, 2 replies; 6+ messages in thread
From: Cao jin @ 2016-04-17  7:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: armbru, pbonzini, peter.maydell

include:
1. remove unnecessary declaration of static function
2. fix inconsistency between comment and function name, and typo OOM->QOM
2. update comments of functions, use uniform format(GTK-Doc style)

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
---
changelog:
1. Use uniform comment format. (Markus)
2. Update function comments. (Markus & Paolo)

comments of qdev_add_legacy_property maybe need polishing, Maintainer who will
take this patch can touch that comment directly:)

 hw/core/qdev.c               | 30 +++++++++++++++++++-----------
 include/hw/qdev-properties.h | 10 ++++++++--
 2 files changed, 27 insertions(+), 13 deletions(-)

diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index db41aa1..204f77b 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -58,9 +58,6 @@ const char *qdev_fw_name(DeviceState *dev)
     return object_get_typename(OBJECT(dev));
 }
 
-static void qdev_property_add_legacy(DeviceState *dev, Property *prop,
-                                     Error **errp);
-
 static void bus_remove_child(BusState *bus, DeviceState *child)
 {
     BusChild *kid;
@@ -908,13 +905,20 @@ static void qdev_get_legacy_property(Object *obj, Visitor *v,
 }
 
 /**
- * @qdev_add_legacy_property - adds a legacy property
+ * qdev_property_add_legacy:
+ * @dev: Device to add the property to.
+ * @prop: The qdev property definition.
+ * @errp: location to store error information.
+ *
+ * Add a legacy QOM property to @dev for qdev property @prop.
+ * On error, store error in @errp.
  *
- * Do not use this is new code!  Properties added through this interface will
- * be given names and types in the "legacy" namespace.
+ * Legacy properties are string versions of QOM properties.  The format of
+ * the string depends on the property type.  Legacy properties are only
+ * needed for "info qtree".
  *
- * Legacy properties are string versions of other OOM properties.  The format
- * of the string depends on the property type.
+ * Do not use this is new code!  QOM Properties added through this interface
+ * will be given names in the "legacy" namespace.
  */
 static void qdev_property_add_legacy(DeviceState *dev, Property *prop,
                                      Error **errp)
@@ -937,10 +941,14 @@ static void qdev_property_add_legacy(DeviceState *dev, Property *prop,
 }
 
 /**
- * @qdev_property_add_static - add a @Property to a device.
+ * qdev_property_add_static:
+ * @dev: Device to add the property to.
+ * @prop: The qdev property definition.
+ * @errp: location to store error information.
  *
- * Static properties access data in a struct.  The actual type of the
- * property and the field depends on the property type.
+ * Add a static QOM property to @dev for qdev property @prop.
+ * On error, store error in @errp.  Static properties access data in a struct.
+ * The type of the QOM property is derived from prop->info.
  */
 void qdev_property_add_static(DeviceState *dev, Property *prop,
                               Error **errp)
diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
index 0586cac..034b75a 100644
--- a/include/hw/qdev-properties.h
+++ b/include/hw/qdev-properties.h
@@ -197,8 +197,14 @@ void error_set_from_qdev_prop_error(Error **errp, int ret, DeviceState *dev,
                                     Property *prop, const char *value);
 
 /**
- * @qdev_property_add_static - add a @Property to a device referencing a
- * field in a struct.
+ * qdev_property_add_static:
+ * @dev: Device to add the property to.
+ * @prop: The qdev property definition.
+ * @errp: location to store error information.
+ *
+ * Add a static QOM property to @dev for qdev property @prop.
+ * On error, store error in @errp.  Static properties access data in a struct.
+ * The type of the QOM property is derived from prop->info.
  */
 void qdev_property_add_static(DeviceState *dev, Property *prop, Error **errp);
 
-- 
2.1.0

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

* Re: [Qemu-devel] [PATCH v2] qdev: Clean up around properties
  2016-04-17  7:45 [Qemu-devel] [PATCH v2] qdev: Clean up around properties Cao jin
@ 2016-04-18  6:53 ` Markus Armbruster
  2016-05-10 12:52 ` Paolo Bonzini
  1 sibling, 0 replies; 6+ messages in thread
From: Markus Armbruster @ 2016-04-18  6:53 UTC (permalink / raw)
  To: Cao jin; +Cc: qemu-devel, pbonzini, peter.maydell

Cao jin <caoj.fnst@cn.fujitsu.com> writes:

> include:
> 1. remove unnecessary declaration of static function
> 2. fix inconsistency between comment and function name, and typo OOM->QOM
> 2. update comments of functions, use uniform format(GTK-Doc style)
>
> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>

Reviewed-by: Markus Armbruster <armbru@redhat.com>

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

* Re: [Qemu-devel] [PATCH v2] qdev: Clean up around properties
  2016-04-17  7:45 [Qemu-devel] [PATCH v2] qdev: Clean up around properties Cao jin
  2016-04-18  6:53 ` Markus Armbruster
@ 2016-05-10 12:52 ` Paolo Bonzini
  2016-05-11  8:24   ` Cao jin
  2016-05-29  8:30   ` Michael Tokarev
  1 sibling, 2 replies; 6+ messages in thread
From: Paolo Bonzini @ 2016-05-10 12:52 UTC (permalink / raw)
  To: Cao jin, qemu-devel; +Cc: armbru, peter.maydell, qemu-trivial

Just comments, so

Cc: qemu-trivial@nongnu.org

On 17/04/2016 09:45, Cao jin wrote:
> include:
> 1. remove unnecessary declaration of static function
> 2. fix inconsistency between comment and function name, and typo OOM->QOM
> 2. update comments of functions, use uniform format(GTK-Doc style)
> 
> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> ---
> changelog:
> 1. Use uniform comment format. (Markus)
> 2. Update function comments. (Markus & Paolo)
> 
> comments of qdev_add_legacy_property maybe need polishing, Maintainer who will
> take this patch can touch that comment directly:)
> 
>  hw/core/qdev.c               | 30 +++++++++++++++++++-----------
>  include/hw/qdev-properties.h | 10 ++++++++--
>  2 files changed, 27 insertions(+), 13 deletions(-)
> 
> diff --git a/hw/core/qdev.c b/hw/core/qdev.c
> index db41aa1..204f77b 100644
> --- a/hw/core/qdev.c
> +++ b/hw/core/qdev.c
> @@ -58,9 +58,6 @@ const char *qdev_fw_name(DeviceState *dev)
>      return object_get_typename(OBJECT(dev));
>  }
>  
> -static void qdev_property_add_legacy(DeviceState *dev, Property *prop,
> -                                     Error **errp);
> -
>  static void bus_remove_child(BusState *bus, DeviceState *child)
>  {
>      BusChild *kid;
> @@ -908,13 +905,20 @@ static void qdev_get_legacy_property(Object *obj, Visitor *v,
>  }
>  
>  /**
> - * @qdev_add_legacy_property - adds a legacy property
> + * qdev_property_add_legacy:
> + * @dev: Device to add the property to.
> + * @prop: The qdev property definition.
> + * @errp: location to store error information.
> + *
> + * Add a legacy QOM property to @dev for qdev property @prop.
> + * On error, store error in @errp.
>   *
> - * Do not use this is new code!  Properties added through this interface will
> - * be given names and types in the "legacy" namespace.
> + * Legacy properties are string versions of QOM properties.  The format of
> + * the string depends on the property type.  Legacy properties are only
> + * needed for "info qtree".
>   *
> - * Legacy properties are string versions of other OOM properties.  The format
> - * of the string depends on the property type.
> + * Do not use this is new code!  QOM Properties added through this interface
> + * will be given names in the "legacy" namespace.
>   */
>  static void qdev_property_add_legacy(DeviceState *dev, Property *prop,
>                                       Error **errp)
> @@ -937,10 +941,14 @@ static void qdev_property_add_legacy(DeviceState *dev, Property *prop,
>  }
>  
>  /**
> - * @qdev_property_add_static - add a @Property to a device.
> + * qdev_property_add_static:
> + * @dev: Device to add the property to.
> + * @prop: The qdev property definition.
> + * @errp: location to store error information.
>   *
> - * Static properties access data in a struct.  The actual type of the
> - * property and the field depends on the property type.
> + * Add a static QOM property to @dev for qdev property @prop.
> + * On error, store error in @errp.  Static properties access data in a struct.
> + * The type of the QOM property is derived from prop->info.
>   */
>  void qdev_property_add_static(DeviceState *dev, Property *prop,
>                                Error **errp)
> diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
> index 0586cac..034b75a 100644
> --- a/include/hw/qdev-properties.h
> +++ b/include/hw/qdev-properties.h
> @@ -197,8 +197,14 @@ void error_set_from_qdev_prop_error(Error **errp, int ret, DeviceState *dev,
>                                      Property *prop, const char *value);
>  
>  /**
> - * @qdev_property_add_static - add a @Property to a device referencing a
> - * field in a struct.
> + * qdev_property_add_static:
> + * @dev: Device to add the property to.
> + * @prop: The qdev property definition.
> + * @errp: location to store error information.
> + *
> + * Add a static QOM property to @dev for qdev property @prop.
> + * On error, store error in @errp.  Static properties access data in a struct.
> + * The type of the QOM property is derived from prop->info.
>   */
>  void qdev_property_add_static(DeviceState *dev, Property *prop, Error **errp);
>  
> 

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

* Re: [Qemu-devel] [PATCH v2] qdev: Clean up around properties
  2016-05-10 12:52 ` Paolo Bonzini
@ 2016-05-11  8:24   ` Cao jin
  2016-05-18 12:15     ` Cao jin
  2016-05-29  8:30   ` Michael Tokarev
  1 sibling, 1 reply; 6+ messages in thread
From: Cao jin @ 2016-05-11  8:24 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial; +Cc: Paolo Bonzini, armbru, peter.maydell

For mjt`s information: it has been

Reviewed-by: Markus Armbruster <armbru@redhat.com>

On 05/10/2016 08:52 PM, Paolo Bonzini wrote:
> Just comments, so
>
> Cc: qemu-trivial@nongnu.org
>
> On 17/04/2016 09:45, Cao jin wrote:
>> include:
>> 1. remove unnecessary declaration of static function
>> 2. fix inconsistency between comment and function name, and typo OOM->QOM
>> 2. update comments of functions, use uniform format(GTK-Doc style)
>>
>> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
>> ---
>> changelog:
>> 1. Use uniform comment format. (Markus)
>> 2. Update function comments. (Markus & Paolo)
>>
>> comments of qdev_add_legacy_property maybe need polishing, Maintainer who will
>> take this patch can touch that comment directly:)
>>
>>   hw/core/qdev.c               | 30 +++++++++++++++++++-----------
>>   include/hw/qdev-properties.h | 10 ++++++++--
>>   2 files changed, 27 insertions(+), 13 deletions(-)
>>
>> diff --git a/hw/core/qdev.c b/hw/core/qdev.c
>> index db41aa1..204f77b 100644
>> --- a/hw/core/qdev.c
>> +++ b/hw/core/qdev.c
>> @@ -58,9 +58,6 @@ const char *qdev_fw_name(DeviceState *dev)
>>       return object_get_typename(OBJECT(dev));
>>   }
>>
>> -static void qdev_property_add_legacy(DeviceState *dev, Property *prop,
>> -                                     Error **errp);
>> -
>>   static void bus_remove_child(BusState *bus, DeviceState *child)
>>   {
>>       BusChild *kid;
>> @@ -908,13 +905,20 @@ static void qdev_get_legacy_property(Object *obj, Visitor *v,
>>   }
>>
>>   /**
>> - * @qdev_add_legacy_property - adds a legacy property
>> + * qdev_property_add_legacy:
>> + * @dev: Device to add the property to.
>> + * @prop: The qdev property definition.
>> + * @errp: location to store error information.
>> + *
>> + * Add a legacy QOM property to @dev for qdev property @prop.
>> + * On error, store error in @errp.
>>    *
>> - * Do not use this is new code!  Properties added through this interface will
>> - * be given names and types in the "legacy" namespace.
>> + * Legacy properties are string versions of QOM properties.  The format of
>> + * the string depends on the property type.  Legacy properties are only
>> + * needed for "info qtree".
>>    *
>> - * Legacy properties are string versions of other OOM properties.  The format
>> - * of the string depends on the property type.
>> + * Do not use this is new code!  QOM Properties added through this interface
>> + * will be given names in the "legacy" namespace.
>>    */
>>   static void qdev_property_add_legacy(DeviceState *dev, Property *prop,
>>                                        Error **errp)
>> @@ -937,10 +941,14 @@ static void qdev_property_add_legacy(DeviceState *dev, Property *prop,
>>   }
>>
>>   /**
>> - * @qdev_property_add_static - add a @Property to a device.
>> + * qdev_property_add_static:
>> + * @dev: Device to add the property to.
>> + * @prop: The qdev property definition.
>> + * @errp: location to store error information.
>>    *
>> - * Static properties access data in a struct.  The actual type of the
>> - * property and the field depends on the property type.
>> + * Add a static QOM property to @dev for qdev property @prop.
>> + * On error, store error in @errp.  Static properties access data in a struct.
>> + * The type of the QOM property is derived from prop->info.
>>    */
>>   void qdev_property_add_static(DeviceState *dev, Property *prop,
>>                                 Error **errp)
>> diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
>> index 0586cac..034b75a 100644
>> --- a/include/hw/qdev-properties.h
>> +++ b/include/hw/qdev-properties.h
>> @@ -197,8 +197,14 @@ void error_set_from_qdev_prop_error(Error **errp, int ret, DeviceState *dev,
>>                                       Property *prop, const char *value);
>>
>>   /**
>> - * @qdev_property_add_static - add a @Property to a device referencing a
>> - * field in a struct.
>> + * qdev_property_add_static:
>> + * @dev: Device to add the property to.
>> + * @prop: The qdev property definition.
>> + * @errp: location to store error information.
>> + *
>> + * Add a static QOM property to @dev for qdev property @prop.
>> + * On error, store error in @errp.  Static properties access data in a struct.
>> + * The type of the QOM property is derived from prop->info.
>>    */
>>   void qdev_property_add_static(DeviceState *dev, Property *prop, Error **errp);
>>
>>
>
>
> .
>

-- 
Yours Sincerely,

Cao jin

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

* Re: [Qemu-devel] [PATCH v2] qdev: Clean up around properties
  2016-05-11  8:24   ` Cao jin
@ 2016-05-18 12:15     ` Cao jin
  0 siblings, 0 replies; 6+ messages in thread
From: Cao jin @ 2016-05-18 12:15 UTC (permalink / raw)
  To: Michael Tokarev
  Cc: qemu-devel, qemu-trivial, Paolo Bonzini, armbru, peter.maydell

Hi Michael,
     I guess you missed this one:)

On 05/11/2016 04:24 PM, Cao jin wrote:
> For mjt`s information: it has been
>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
>
> On 05/10/2016 08:52 PM, Paolo Bonzini wrote:
>> Just comments, so
>>
>> Cc: qemu-trivial@nongnu.org
>>
>> On 17/04/2016 09:45, Cao jin wrote:
>>> include:
>>> 1. remove unnecessary declaration of static function
>>> 2. fix inconsistency between comment and function name, and typo
>>> OOM->QOM
>>> 2. update comments of functions, use uniform format(GTK-Doc style)
>>>
>>> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
>>> ---
>>> changelog:
>>> 1. Use uniform comment format. (Markus)
>>> 2. Update function comments. (Markus & Paolo)
>>>
>>> comments of qdev_add_legacy_property maybe need polishing, Maintainer
>>> who will
>>> take this patch can touch that comment directly:)
>>>
>>>   hw/core/qdev.c               | 30 +++++++++++++++++++-----------
>>>   include/hw/qdev-properties.h | 10 ++++++++--
>>>   2 files changed, 27 insertions(+), 13 deletions(-)
>>>
>>> diff --git a/hw/core/qdev.c b/hw/core/qdev.c
>>> index db41aa1..204f77b 100644
>>> --- a/hw/core/qdev.c
>>> +++ b/hw/core/qdev.c
>>> @@ -58,9 +58,6 @@ const char *qdev_fw_name(DeviceState *dev)
>>>       return object_get_typename(OBJECT(dev));
>>>   }
>>>
>>> -static void qdev_property_add_legacy(DeviceState *dev, Property *prop,
>>> -                                     Error **errp);
>>> -
>>>   static void bus_remove_child(BusState *bus, DeviceState *child)
>>>   {
>>>       BusChild *kid;
>>> @@ -908,13 +905,20 @@ static void qdev_get_legacy_property(Object
>>> *obj, Visitor *v,
>>>   }
>>>
>>>   /**
>>> - * @qdev_add_legacy_property - adds a legacy property
>>> + * qdev_property_add_legacy:
>>> + * @dev: Device to add the property to.
>>> + * @prop: The qdev property definition.
>>> + * @errp: location to store error information.
>>> + *
>>> + * Add a legacy QOM property to @dev for qdev property @prop.
>>> + * On error, store error in @errp.
>>>    *
>>> - * Do not use this is new code!  Properties added through this
>>> interface will
>>> - * be given names and types in the "legacy" namespace.
>>> + * Legacy properties are string versions of QOM properties.  The
>>> format of
>>> + * the string depends on the property type.  Legacy properties are only
>>> + * needed for "info qtree".
>>>    *
>>> - * Legacy properties are string versions of other OOM properties.
>>> The format
>>> - * of the string depends on the property type.
>>> + * Do not use this is new code!  QOM Properties added through this
>>> interface
>>> + * will be given names in the "legacy" namespace.
>>>    */
>>>   static void qdev_property_add_legacy(DeviceState *dev, Property *prop,
>>>                                        Error **errp)
>>> @@ -937,10 +941,14 @@ static void
>>> qdev_property_add_legacy(DeviceState *dev, Property *prop,
>>>   }
>>>
>>>   /**
>>> - * @qdev_property_add_static - add a @Property to a device.
>>> + * qdev_property_add_static:
>>> + * @dev: Device to add the property to.
>>> + * @prop: The qdev property definition.
>>> + * @errp: location to store error information.
>>>    *
>>> - * Static properties access data in a struct.  The actual type of the
>>> - * property and the field depends on the property type.
>>> + * Add a static QOM property to @dev for qdev property @prop.
>>> + * On error, store error in @errp.  Static properties access data in
>>> a struct.
>>> + * The type of the QOM property is derived from prop->info.
>>>    */
>>>   void qdev_property_add_static(DeviceState *dev, Property *prop,
>>>                                 Error **errp)
>>> diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
>>> index 0586cac..034b75a 100644
>>> --- a/include/hw/qdev-properties.h
>>> +++ b/include/hw/qdev-properties.h
>>> @@ -197,8 +197,14 @@ void error_set_from_qdev_prop_error(Error
>>> **errp, int ret, DeviceState *dev,
>>>                                       Property *prop, const char
>>> *value);
>>>
>>>   /**
>>> - * @qdev_property_add_static - add a @Property to a device
>>> referencing a
>>> - * field in a struct.
>>> + * qdev_property_add_static:
>>> + * @dev: Device to add the property to.
>>> + * @prop: The qdev property definition.
>>> + * @errp: location to store error information.
>>> + *
>>> + * Add a static QOM property to @dev for qdev property @prop.
>>> + * On error, store error in @errp.  Static properties access data in
>>> a struct.
>>> + * The type of the QOM property is derived from prop->info.
>>>    */
>>>   void qdev_property_add_static(DeviceState *dev, Property *prop,
>>> Error **errp);
>>>
>>>
>>
>>
>> .
>>
>

-- 
Yours Sincerely,

Cao jin

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

* Re: [Qemu-devel] [PATCH v2] qdev: Clean up around properties
  2016-05-10 12:52 ` Paolo Bonzini
  2016-05-11  8:24   ` Cao jin
@ 2016-05-29  8:30   ` Michael Tokarev
  1 sibling, 0 replies; 6+ messages in thread
From: Michael Tokarev @ 2016-05-29  8:30 UTC (permalink / raw)
  To: Paolo Bonzini, Cao jin, qemu-devel; +Cc: qemu-trivial, peter.maydell, armbru

10.05.2016 15:52, Paolo Bonzini wrote:
> Just comments, so
> 
> Cc: qemu-trivial@nongnu.org
> 
> On 17/04/2016 09:45, Cao jin wrote:
>> include:
>> 1. remove unnecessary declaration of static function
>> 2. fix inconsistency between comment and function name, and typo OOM->QOM
>> 2. update comments of functions, use uniform format(GTK-Doc style)

Applied to -trivial, thanks!

/mjt

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

end of thread, other threads:[~2016-05-29  8:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-17  7:45 [Qemu-devel] [PATCH v2] qdev: Clean up around properties Cao jin
2016-04-18  6:53 ` Markus Armbruster
2016-05-10 12:52 ` Paolo Bonzini
2016-05-11  8:24   ` Cao jin
2016-05-18 12:15     ` Cao jin
2016-05-29  8:30   ` Michael Tokarev

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).