All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] qom documentation fixes
@ 2020-10-03  2:54 Eduardo Habkost
  2020-10-03  2:54 ` [PATCH 1/6] qom: Fix DECLARE_*CHECKER documentation Eduardo Habkost
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Eduardo Habkost @ 2020-10-03  2:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Daniel P. Berrangé, Eduardo Habkost

A few fixes to the QOM documentation in docs/devel/qom.rst and
include/qom/object.h.

Eduardo Habkost (6):
  qom: Fix DECLARE_*CHECKER documentation
  docs/devel/qom: Fix indentation of bulleted list
  docs/devel/qom: Fix indentation of code blocks
  docs/devel/qom: Use *emphasis* for emphasis
  docs/devel/qom: Remove usage of <code>
  docs/devel/qom: Avoid long lines

 docs/devel/qom.rst   | 91 +++++++++++++++++++++++---------------------
 include/qom/object.h | 16 ++++----
 2 files changed, 55 insertions(+), 52 deletions(-)

-- 
2.26.2




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

* [PATCH 1/6] qom: Fix DECLARE_*CHECKER documentation
  2020-10-03  2:54 [PATCH 0/6] qom documentation fixes Eduardo Habkost
@ 2020-10-03  2:54 ` Eduardo Habkost
  2020-10-03 17:56   ` Philippe Mathieu-Daudé
  2020-10-03  2:54 ` [PATCH 2/6] docs/devel/qom: Fix indentation of bulleted list Eduardo Habkost
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 12+ messages in thread
From: Eduardo Habkost @ 2020-10-03  2:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Daniel P. Berrangé, Eduardo Habkost

Correct copy/paste mistake in the DECLARE_INSTANCE_CHECKER and
DECLARE_CLASS_CHECKERS documentation.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 include/qom/object.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/qom/object.h b/include/qom/object.h
index 27aaa67e63f..e738dfc6744 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -170,7 +170,7 @@ struct Object
  * Direct usage of this macro should be avoided, and the complete
  * OBJECT_DECLARE_TYPE macro is recommended instead.
  *
- * This macro will provide the three standard type cast functions for a
+ * This macro will provide the the instance type cast functions for a
  * QOM type.
  */
 #define DECLARE_INSTANCE_CHECKER(InstanceType, OBJ_NAME, TYPENAME) \
@@ -187,7 +187,7 @@ struct Object
  * Direct usage of this macro should be avoided, and the complete
  * OBJECT_DECLARE_TYPE macro is recommended instead.
  *
- * This macro will provide the three standard type cast functions for a
+ * This macro will provide the class type cast functions for a
  * QOM type.
  */
 #define DECLARE_CLASS_CHECKERS(ClassType, OBJ_NAME, TYPENAME) \
-- 
2.26.2



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

* [PATCH 2/6] docs/devel/qom: Fix indentation of bulleted list
  2020-10-03  2:54 [PATCH 0/6] qom documentation fixes Eduardo Habkost
  2020-10-03  2:54 ` [PATCH 1/6] qom: Fix DECLARE_*CHECKER documentation Eduardo Habkost
@ 2020-10-03  2:54 ` Eduardo Habkost
  2020-10-03  2:54 ` [PATCH 3/6] docs/devel/qom: Fix indentation of code blocks Eduardo Habkost
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Eduardo Habkost @ 2020-10-03  2:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Daniel P. Berrangé, Eduardo Habkost

The list was incorrectly parsed as a literal block due to
indentation.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 docs/devel/qom.rst | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/docs/devel/qom.rst b/docs/devel/qom.rst
index 0b943b2a1a8..c4857d95c8e 100644
--- a/docs/devel/qom.rst
+++ b/docs/devel/qom.rst
@@ -8,9 +8,9 @@ The QEMU Object Model provides a framework for registering user creatable
 types and instantiating objects from those types.  QOM provides the following
 features:
 
- - System for dynamically registering types
- - Support for single-inheritance of types
- - Multiple inheritance of stateless interfaces
+- System for dynamically registering types
+- Support for single-inheritance of types
+- Multiple inheritance of stateless interfaces
 
 .. code-block:: c
    :caption: Creating a minimal type
-- 
2.26.2



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

* [PATCH 3/6] docs/devel/qom: Fix indentation of code blocks
  2020-10-03  2:54 [PATCH 0/6] qom documentation fixes Eduardo Habkost
  2020-10-03  2:54 ` [PATCH 1/6] qom: Fix DECLARE_*CHECKER documentation Eduardo Habkost
  2020-10-03  2:54 ` [PATCH 2/6] docs/devel/qom: Fix indentation of bulleted list Eduardo Habkost
@ 2020-10-03  2:54 ` Eduardo Habkost
  2020-10-03  2:54 ` [PATCH 4/6] docs/devel/qom: Use *emphasis* for emphasis Eduardo Habkost
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Eduardo Habkost @ 2020-10-03  2:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Daniel P. Berrangé, Eduardo Habkost

Some code blocks had one extra space, fix that.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 docs/devel/qom.rst | 76 +++++++++++++++++++++++-----------------------
 1 file changed, 38 insertions(+), 38 deletions(-)

diff --git a/docs/devel/qom.rst b/docs/devel/qom.rst
index c4857d95c8e..a47e1b9a239 100644
--- a/docs/devel/qom.rst
+++ b/docs/devel/qom.rst
@@ -284,28 +284,28 @@ in the header file:
 .. code-block:: c
    :caption: Declaring a simple type
 
-    OBJECT_DECLARE_SIMPLE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)
+   OBJECT_DECLARE_SIMPLE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)
 
 This is equivalent to the following:
 
 .. code-block:: c
    :caption: Expansion from declaring a simple type
 
-    typedef struct MyDevice MyDevice;
-    typedef struct MyDeviceClass MyDeviceClass;
+   typedef struct MyDevice MyDevice;
+   typedef struct MyDeviceClass MyDeviceClass;
 
-    G_DEFINE_AUTOPTR_CLEANUP_FUNC(MyDeviceClass, object_unref)
+   G_DEFINE_AUTOPTR_CLEANUP_FUNC(MyDeviceClass, object_unref)
 
-    #define MY_DEVICE_GET_CLASS(void *obj) \
-            OBJECT_GET_CLASS(MyDeviceClass, obj, TYPE_MY_DEVICE)
-    #define MY_DEVICE_CLASS(void *klass) \
-            OBJECT_CLASS_CHECK(MyDeviceClass, klass, TYPE_MY_DEVICE)
-    #define MY_DEVICE(void *obj)
-            OBJECT_CHECK(MyDevice, obj, TYPE_MY_DEVICE)
+   #define MY_DEVICE_GET_CLASS(void *obj) \
+           OBJECT_GET_CLASS(MyDeviceClass, obj, TYPE_MY_DEVICE)
+   #define MY_DEVICE_CLASS(void *klass) \
+           OBJECT_CLASS_CHECK(MyDeviceClass, klass, TYPE_MY_DEVICE)
+   #define MY_DEVICE(void *obj)
+           OBJECT_CHECK(MyDevice, obj, TYPE_MY_DEVICE)
 
-    struct MyDeviceClass {
-        DeviceClass parent_class;
-    };
+   struct MyDeviceClass {
+       DeviceClass parent_class;
+   };
 
 The 'struct MyDevice' needs to be declared separately.
 If the type requires virtual functions to be declared in the class
@@ -319,33 +319,33 @@ In the simple case the OBJECT_DEFINE_TYPE macro is suitable:
 .. code-block:: c
    :caption: Defining a simple type
 
-    OBJECT_DEFINE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)
+   OBJECT_DEFINE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)
 
 This is equivalent to the following:
 
 .. code-block:: c
    :caption: Expansion from defining a simple type
 
-    static void my_device_finalize(Object *obj);
-    static void my_device_class_init(ObjectClass *oc, void *data);
-    static void my_device_init(Object *obj);
-
-    static const TypeInfo my_device_info = {
-        .parent = TYPE_DEVICE,
-        .name = TYPE_MY_DEVICE,
-        .instance_size = sizeof(MyDevice),
-        .instance_init = my_device_init,
-        .instance_finalize = my_device_finalize,
-        .class_size = sizeof(MyDeviceClass),
-        .class_init = my_device_class_init,
-    };
-
-    static void
-    my_device_register_types(void)
-    {
-        type_register_static(&my_device_info);
-    }
-    type_init(my_device_register_types);
+   static void my_device_finalize(Object *obj);
+   static void my_device_class_init(ObjectClass *oc, void *data);
+   static void my_device_init(Object *obj);
+
+   static const TypeInfo my_device_info = {
+       .parent = TYPE_DEVICE,
+       .name = TYPE_MY_DEVICE,
+       .instance_size = sizeof(MyDevice),
+       .instance_init = my_device_init,
+       .instance_finalize = my_device_finalize,
+       .class_size = sizeof(MyDeviceClass),
+       .class_init = my_device_class_init,
+   };
+
+   static void
+   my_device_register_types(void)
+   {
+       type_register_static(&my_device_info);
+   }
+   type_init(my_device_register_types);
 
 This is sufficient to get the type registered with the type
 system, and the three standard methods now need to be implemented
@@ -358,9 +358,9 @@ This accepts an array of interface type names.
 .. code-block:: c
    :caption: Defining a simple type implementing interfaces
 
-    OBJECT_DEFINE_TYPE_WITH_INTERFACES(MyDevice, my_device,
-                                       MY_DEVICE, DEVICE,
-                                       { TYPE_USER_CREATABLE }, { NULL })
+   OBJECT_DEFINE_TYPE_WITH_INTERFACES(MyDevice, my_device,
+                                      MY_DEVICE, DEVICE,
+                                      { TYPE_USER_CREATABLE }, { NULL })
 
 If the type is not intended to be instantiated, then then
 the OBJECT_DEFINE_ABSTRACT_TYPE() macro can be used instead:
@@ -368,7 +368,7 @@ the OBJECT_DEFINE_ABSTRACT_TYPE() macro can be used instead:
 .. code-block:: c
    :caption: Defining a simple abstract type
 
-    OBJECT_DEFINE_ABSTRACT_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)
+   OBJECT_DEFINE_ABSTRACT_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)
 
 
 
-- 
2.26.2



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

* [PATCH 4/6] docs/devel/qom: Use *emphasis* for emphasis
  2020-10-03  2:54 [PATCH 0/6] qom documentation fixes Eduardo Habkost
                   ` (2 preceding siblings ...)
  2020-10-03  2:54 ` [PATCH 3/6] docs/devel/qom: Fix indentation of code blocks Eduardo Habkost
@ 2020-10-03  2:54 ` Eduardo Habkost
  2020-10-03 17:55   ` Philippe Mathieu-Daudé
  2020-10-03  2:54 ` [PATCH 5/6] docs/devel/qom: Remove usage of <code> Eduardo Habkost
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 12+ messages in thread
From: Eduardo Habkost @ 2020-10-03  2:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Daniel P. Berrangé, Eduardo Habkost

<emphasis> is not valid reST syntax.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 docs/devel/qom.rst | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/docs/devel/qom.rst b/docs/devel/qom.rst
index a47e1b9a239..0c610e20d62 100644
--- a/docs/devel/qom.rst
+++ b/docs/devel/qom.rst
@@ -174,17 +174,17 @@ dynamically cast it to an object that implements the interface.
 Methods
 =======
 
-A <emphasis>method</emphasis> is a function within the namespace scope of
+A *method* is a function within the namespace scope of
 a class. It usually operates on the object instance by passing it as a
 strongly-typed first argument.
 If it does not operate on an object instance, it is dubbed
-<emphasis>class method</emphasis>.
+*class method*.
 
 Methods cannot be overloaded. That is, the #ObjectClass and method name
 uniquely identity the function to be called; the signature does not vary
 except for trailing varargs.
 
-Methods are always <emphasis>virtual</emphasis>. Overriding a method in
+Methods are always *virtual*. Overriding a method in
 #TypeInfo.class_init of a subclass leads to any user of the class obtained
 via OBJECT_GET_CLASS() accessing the overridden function.
 The original function is not automatically invoked. It is the responsibility
-- 
2.26.2



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

* [PATCH 5/6] docs/devel/qom: Remove usage of <code>
  2020-10-03  2:54 [PATCH 0/6] qom documentation fixes Eduardo Habkost
                   ` (3 preceding siblings ...)
  2020-10-03  2:54 ` [PATCH 4/6] docs/devel/qom: Use *emphasis* for emphasis Eduardo Habkost
@ 2020-10-03  2:54 ` Eduardo Habkost
  2020-10-03  9:03   ` Paolo Bonzini
  2020-10-03  2:54 ` [PATCH 6/6] docs/devel/qom: Avoid long lines Eduardo Habkost
  2020-10-03  9:03 ` [PATCH 0/6] qom documentation fixes Paolo Bonzini
  6 siblings, 1 reply; 12+ messages in thread
From: Eduardo Habkost @ 2020-10-03  2:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Daniel P. Berrangé, Eduardo Habkost

<code> is not valid reST syntax.

Function @argument references don't need additional markup, so
just remove <code></code>.

Constants were changed to use reST ``code`` syntax

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 include/qom/object.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/qom/object.h b/include/qom/object.h
index e738dfc6744..16c9bcdf3b0 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -1256,7 +1256,7 @@ char *object_property_get_str(Object *obj, const char *name,
  * Writes an object's canonical path to a property.
  *
  * If the link property was created with
- * <code>OBJ_PROP_LINK_STRONG</code> bit, the old target object is
+ * ``OBJ_PROP_LINK_STRONG`` bit, the old target object is
  * unreferenced, and a reference is added to the new target object.
  *
  * Returns: %true on success, %false on failure.
@@ -1603,16 +1603,16 @@ void object_property_allow_set_link(const Object *obj, const char *name,
  *
  * Links form the graph in the object model.
  *
- * The <code>@check()</code> callback is invoked when
+ * The @check() callback is invoked when
  * object_property_set_link() is called and can raise an error to prevent the
- * link being set.  If <code>@check</code> is NULL, the property is read-only
+ * link being set.  If @check is NULL, the property is read-only
  * and cannot be set.
  *
  * Ownership of the pointer that @child points to is transferred to the
- * link property.  The reference count for <code>*@child</code> is
+ * link property.  The reference count for *@child is
  * managed by the property from after the function returns till the
  * property is deleted with object_property_del().  If the
- * <code>@flags</code> <code>OBJ_PROP_LINK_STRONG</code> bit is set,
+ * @flags ``OBJ_PROP_LINK_STRONG`` bit is set,
  * the reference count is decremented when the property is deleted or
  * modified.
  *
@@ -1823,7 +1823,7 @@ ObjectProperty *object_class_property_add_uint64_ptr(ObjectClass *klass,
  * Add an alias for a property on an object.  This function will add a property
  * of the same type as the forwarded property.
  *
- * The caller must ensure that <code>@target_obj</code> stays alive as long as
+ * The caller must ensure that @target_obj stays alive as long as
  * this property exists.  In the case of a child object or an alias on the same
  * object this will be the case.  For aliases to other objects the caller is
  * responsible for taking a reference.
-- 
2.26.2



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

* [PATCH 6/6] docs/devel/qom: Avoid long lines
  2020-10-03  2:54 [PATCH 0/6] qom documentation fixes Eduardo Habkost
                   ` (4 preceding siblings ...)
  2020-10-03  2:54 ` [PATCH 5/6] docs/devel/qom: Remove usage of <code> Eduardo Habkost
@ 2020-10-03  2:54 ` Eduardo Habkost
  2020-10-03 17:56   ` Philippe Mathieu-Daudé
  2020-10-03  9:03 ` [PATCH 0/6] qom documentation fixes Paolo Bonzini
  6 siblings, 1 reply; 12+ messages in thread
From: Eduardo Habkost @ 2020-10-03  2:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Daniel P. Berrangé, Eduardo Habkost

Long code lines don't look good in the rendered documents, make
them shorter.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 docs/devel/qom.rst | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/docs/devel/qom.rst b/docs/devel/qom.rst
index 0c610e20d62..42d0dc4f4da 100644
--- a/docs/devel/qom.rst
+++ b/docs/devel/qom.rst
@@ -284,7 +284,8 @@ in the header file:
 .. code-block:: c
    :caption: Declaring a simple type
 
-   OBJECT_DECLARE_SIMPLE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)
+   OBJECT_DECLARE_SIMPLE_TYPE(MyDevice, my_device,
+                              MY_DEVICE, DEVICE)
 
 This is equivalent to the following:
 
@@ -360,7 +361,8 @@ This accepts an array of interface type names.
 
    OBJECT_DEFINE_TYPE_WITH_INTERFACES(MyDevice, my_device,
                                       MY_DEVICE, DEVICE,
-                                      { TYPE_USER_CREATABLE }, { NULL })
+                                      { TYPE_USER_CREATABLE },
+                                      { NULL })
 
 If the type is not intended to be instantiated, then then
 the OBJECT_DEFINE_ABSTRACT_TYPE() macro can be used instead:
@@ -368,7 +370,8 @@ the OBJECT_DEFINE_ABSTRACT_TYPE() macro can be used instead:
 .. code-block:: c
    :caption: Defining a simple abstract type
 
-   OBJECT_DEFINE_ABSTRACT_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)
+   OBJECT_DEFINE_ABSTRACT_TYPE(MyDevice, my_device,
+                               MY_DEVICE, DEVICE)
 
 
 
-- 
2.26.2



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

* Re: [PATCH 5/6] docs/devel/qom: Remove usage of <code>
  2020-10-03  2:54 ` [PATCH 5/6] docs/devel/qom: Remove usage of <code> Eduardo Habkost
@ 2020-10-03  9:03   ` Paolo Bonzini
  0 siblings, 0 replies; 12+ messages in thread
From: Paolo Bonzini @ 2020-10-03  9:03 UTC (permalink / raw)
  To: Eduardo Habkost, qemu-devel; +Cc: Daniel P. Berrangé

On 03/10/20 04:54, Eduardo Habkost wrote:
> <code> is not valid reST syntax.
> 
> Function @argument references don't need additional markup, so
> just remove <code></code>.
> 
> Constants were changed to use reST ``code`` syntax
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>  include/qom/object.h | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/include/qom/object.h b/include/qom/object.h
> index e738dfc6744..16c9bcdf3b0 100644
> --- a/include/qom/object.h
> +++ b/include/qom/object.h
> @@ -1256,7 +1256,7 @@ char *object_property_get_str(Object *obj, const char *name,
>   * Writes an object's canonical path to a property.
>   *
>   * If the link property was created with
> - * <code>OBJ_PROP_LINK_STRONG</code> bit, the old target object is
> + * ``OBJ_PROP_LINK_STRONG`` bit, the old target object is
>   * unreferenced, and a reference is added to the new target object.
>   *
>   * Returns: %true on success, %false on failure.
> @@ -1603,16 +1603,16 @@ void object_property_allow_set_link(const Object *obj, const char *name,
>   *
>   * Links form the graph in the object model.
>   *
> - * The <code>@check()</code> callback is invoked when
> + * The @check() callback is invoked when
>   * object_property_set_link() is called and can raise an error to prevent the
> - * link being set.  If <code>@check</code> is NULL, the property is read-only
> + * link being set.  If @check is NULL, the property is read-only
>   * and cannot be set.
>   *
>   * Ownership of the pointer that @child points to is transferred to the
> - * link property.  The reference count for <code>*@child</code> is
> + * link property.  The reference count for *@child is
>   * managed by the property from after the function returns till the
>   * property is deleted with object_property_del().  If the
> - * <code>@flags</code> <code>OBJ_PROP_LINK_STRONG</code> bit is set,
> + * @flags ``OBJ_PROP_LINK_STRONG`` bit is set,
>   * the reference count is decremented when the property is deleted or
>   * modified.

You can use % too in this case and in the first hunk above; there's
actually no difference between ``a`` and %a except the latter is
shorter.  Linux generally prefers %a, though kernel-doc also knows about
``a`` so that ``%x`` is interpreted correctly when the percent sign
should be a literal.

Apart from that.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo

>   *
> @@ -1823,7 +1823,7 @@ ObjectProperty *object_class_property_add_uint64_ptr(ObjectClass *klass,
>   * Add an alias for a property on an object.  This function will add a property
>   * of the same type as the forwarded property.
>   *
> - * The caller must ensure that <code>@target_obj</code> stays alive as long as
> + * The caller must ensure that @target_obj stays alive as long as
>   * this property exists.  In the case of a child object or an alias on the same
>   * object this will be the case.  For aliases to other objects the caller is
>   * responsible for taking a reference.
> 



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

* Re: [PATCH 0/6] qom documentation fixes
  2020-10-03  2:54 [PATCH 0/6] qom documentation fixes Eduardo Habkost
                   ` (5 preceding siblings ...)
  2020-10-03  2:54 ` [PATCH 6/6] docs/devel/qom: Avoid long lines Eduardo Habkost
@ 2020-10-03  9:03 ` Paolo Bonzini
  6 siblings, 0 replies; 12+ messages in thread
From: Paolo Bonzini @ 2020-10-03  9:03 UTC (permalink / raw)
  To: Eduardo Habkost, qemu-devel; +Cc: Daniel P. Berrangé

On 03/10/20 04:54, Eduardo Habkost wrote:
> A few fixes to the QOM documentation in docs/devel/qom.rst and
> include/qom/object.h.
> 
> Eduardo Habkost (6):
>   qom: Fix DECLARE_*CHECKER documentation
>   docs/devel/qom: Fix indentation of bulleted list
>   docs/devel/qom: Fix indentation of code blocks
>   docs/devel/qom: Use *emphasis* for emphasis
>   docs/devel/qom: Remove usage of <code>
>   docs/devel/qom: Avoid long lines
> 
>  docs/devel/qom.rst   | 91 +++++++++++++++++++++++---------------------
>  include/qom/object.h | 16 ++++----
>  2 files changed, 55 insertions(+), 52 deletions(-)
> 

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

though see patch 5 for a small note that can even be fixed without a v2.

Paolo



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

* Re: [PATCH 4/6] docs/devel/qom: Use *emphasis* for emphasis
  2020-10-03  2:54 ` [PATCH 4/6] docs/devel/qom: Use *emphasis* for emphasis Eduardo Habkost
@ 2020-10-03 17:55   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-10-03 17:55 UTC (permalink / raw)
  To: Eduardo Habkost, qemu-devel; +Cc: Paolo Bonzini, Daniel P. Berrangé

On 10/3/20 4:54 AM, Eduardo Habkost wrote:
> <emphasis> is not valid reST syntax.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>  docs/devel/qom.rst | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/docs/devel/qom.rst b/docs/devel/qom.rst
> index a47e1b9a239..0c610e20d62 100644
> --- a/docs/devel/qom.rst
> +++ b/docs/devel/qom.rst
> @@ -174,17 +174,17 @@ dynamically cast it to an object that implements the interface.
>  Methods
>  =======
>  
> -A <emphasis>method</emphasis> is a function within the namespace scope of
> +A *method* is a function within the namespace scope of
>  a class. It usually operates on the object instance by passing it as a
>  strongly-typed first argument.
>  If it does not operate on an object instance, it is dubbed
> -<emphasis>class method</emphasis>.
> +*class method*.
>  
>  Methods cannot be overloaded. That is, the #ObjectClass and method name
>  uniquely identity the function to be called; the signature does not vary
>  except for trailing varargs.
>  
> -Methods are always <emphasis>virtual</emphasis>. Overriding a method in
> +Methods are always *virtual*. Overriding a method in
>  #TypeInfo.class_init of a subclass leads to any user of the class obtained
>  via OBJECT_GET_CLASS() accessing the overridden function.
>  The original function is not automatically invoked. It is the responsibility
> 



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

* Re: [PATCH 6/6] docs/devel/qom: Avoid long lines
  2020-10-03  2:54 ` [PATCH 6/6] docs/devel/qom: Avoid long lines Eduardo Habkost
@ 2020-10-03 17:56   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-10-03 17:56 UTC (permalink / raw)
  To: Eduardo Habkost, qemu-devel; +Cc: Paolo Bonzini, Daniel P. Berrangé

On 10/3/20 4:54 AM, Eduardo Habkost wrote:
> Long code lines don't look good in the rendered documents, make
> them shorter.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>  docs/devel/qom.rst | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/docs/devel/qom.rst b/docs/devel/qom.rst
> index 0c610e20d62..42d0dc4f4da 100644
> --- a/docs/devel/qom.rst
> +++ b/docs/devel/qom.rst
> @@ -284,7 +284,8 @@ in the header file:
>  .. code-block:: c
>     :caption: Declaring a simple type
>  
> -   OBJECT_DECLARE_SIMPLE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)
> +   OBJECT_DECLARE_SIMPLE_TYPE(MyDevice, my_device,
> +                              MY_DEVICE, DEVICE)
>  
>  This is equivalent to the following:
>  
> @@ -360,7 +361,8 @@ This accepts an array of interface type names.
>  
>     OBJECT_DEFINE_TYPE_WITH_INTERFACES(MyDevice, my_device,
>                                        MY_DEVICE, DEVICE,
> -                                      { TYPE_USER_CREATABLE }, { NULL })
> +                                      { TYPE_USER_CREATABLE },
> +                                      { NULL })
>  
>  If the type is not intended to be instantiated, then then
>  the OBJECT_DEFINE_ABSTRACT_TYPE() macro can be used instead:
> @@ -368,7 +370,8 @@ the OBJECT_DEFINE_ABSTRACT_TYPE() macro can be used instead:
>  .. code-block:: c
>     :caption: Defining a simple abstract type
>  
> -   OBJECT_DEFINE_ABSTRACT_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)
> +   OBJECT_DEFINE_ABSTRACT_TYPE(MyDevice, my_device,
> +                               MY_DEVICE, DEVICE)
>  
>  
>  
> 



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

* Re: [PATCH 1/6] qom: Fix DECLARE_*CHECKER documentation
  2020-10-03  2:54 ` [PATCH 1/6] qom: Fix DECLARE_*CHECKER documentation Eduardo Habkost
@ 2020-10-03 17:56   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-10-03 17:56 UTC (permalink / raw)
  To: Eduardo Habkost, qemu-devel; +Cc: Paolo Bonzini, Daniel P. Berrangé

On 10/3/20 4:54 AM, Eduardo Habkost wrote:
> Correct copy/paste mistake in the DECLARE_INSTANCE_CHECKER and
> DECLARE_CLASS_CHECKERS documentation.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>  include/qom/object.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/qom/object.h b/include/qom/object.h
> index 27aaa67e63f..e738dfc6744 100644
> --- a/include/qom/object.h
> +++ b/include/qom/object.h
> @@ -170,7 +170,7 @@ struct Object
>   * Direct usage of this macro should be avoided, and the complete
>   * OBJECT_DECLARE_TYPE macro is recommended instead.
>   *
> - * This macro will provide the three standard type cast functions for a
> + * This macro will provide the the instance type cast functions for a

Using a single "the":
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

>   * QOM type.
>   */
>  #define DECLARE_INSTANCE_CHECKER(InstanceType, OBJ_NAME, TYPENAME) \
> @@ -187,7 +187,7 @@ struct Object
>   * Direct usage of this macro should be avoided, and the complete
>   * OBJECT_DECLARE_TYPE macro is recommended instead.
>   *
> - * This macro will provide the three standard type cast functions for a
> + * This macro will provide the class type cast functions for a
>   * QOM type.
>   */
>  #define DECLARE_CLASS_CHECKERS(ClassType, OBJ_NAME, TYPENAME) \
> 



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

end of thread, other threads:[~2020-10-03 17:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-03  2:54 [PATCH 0/6] qom documentation fixes Eduardo Habkost
2020-10-03  2:54 ` [PATCH 1/6] qom: Fix DECLARE_*CHECKER documentation Eduardo Habkost
2020-10-03 17:56   ` Philippe Mathieu-Daudé
2020-10-03  2:54 ` [PATCH 2/6] docs/devel/qom: Fix indentation of bulleted list Eduardo Habkost
2020-10-03  2:54 ` [PATCH 3/6] docs/devel/qom: Fix indentation of code blocks Eduardo Habkost
2020-10-03  2:54 ` [PATCH 4/6] docs/devel/qom: Use *emphasis* for emphasis Eduardo Habkost
2020-10-03 17:55   ` Philippe Mathieu-Daudé
2020-10-03  2:54 ` [PATCH 5/6] docs/devel/qom: Remove usage of <code> Eduardo Habkost
2020-10-03  9:03   ` Paolo Bonzini
2020-10-03  2:54 ` [PATCH 6/6] docs/devel/qom: Avoid long lines Eduardo Habkost
2020-10-03 17:56   ` Philippe Mathieu-Daudé
2020-10-03  9:03 ` [PATCH 0/6] qom documentation fixes Paolo Bonzini

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.