Patchwork qom: Document ways to retrieve child object added by object_property_add_child()

login
register
mail settings
Submitter Alexander Barabash
Date Feb. 21, 2012, 10:14 a.m.
Message ID <1329819262-4617-1-git-send-email-alexander_barabash@mentor.com>
Download mbox | patch
Permalink /patch/142278/
State New
Headers show

Comments

Alexander Barabash - Feb. 21, 2012, 10:14 a.m.
From: Alexander Barabash <alexander_barabash@mentor.com>

object_property_add_child() creates a property whose values as a string is
the child object's canonical path.

Signed-off-by: Alexander Barabash <alexander_barabash@mentor.com>
---
 include/qemu/object.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
Paolo Bonzini - Feb. 21, 2012, 10:16 a.m.
On 02/21/2012 11:14 AM, alexander_barabash@mentor.com wrote:
> From: Alexander Barabash <alexander_barabash@mentor.com>
> 
> object_property_add_child() creates a property whose values as a string is
> the child object's canonical path.
> 
> Signed-off-by: Alexander Barabash <alexander_barabash@mentor.com>
> ---
>  include/qemu/object.h |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/include/qemu/object.h b/include/qemu/object.h
> index ba2409d..d9e9221 100644
> --- a/include/qemu/object.h
> +++ b/include/qemu/object.h
> @@ -808,6 +808,10 @@ Object *object_resolve_path_type(const char *path, const char *typename,
>   *
>   * There is no way for a child to determine what its parent is.  It is not
>   * a bidirectional relationship.  This is by design.
> + *
> + * The value of a child property as a C string will be the child object's
> + * canonical path. It can be retrieved using object_property_get_str().
> + * The child object itself can be retrieved using object_property_get_link().
>   */
>  void object_property_add_child(Object *obj, const char *name,
>                                 Object *child, struct Error **errp);

Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Anthony Liguori - Feb. 22, 2012, 6:51 p.m.
On 02/21/2012 04:14 AM, alexander_barabash@mentor.com wrote:
> From: Alexander Barabash<alexander_barabash@mentor.com>
>
> object_property_add_child() creates a property whose values as a string is
> the child object's canonical path.
>
> Signed-off-by: Alexander Barabash<alexander_barabash@mentor.com>

Applied.  Thanks.

Regards,

Anthony Liguori

> ---
>   include/qemu/object.h |    4 ++++
>   1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/include/qemu/object.h b/include/qemu/object.h
> index ba2409d..d9e9221 100644
> --- a/include/qemu/object.h
> +++ b/include/qemu/object.h
> @@ -808,6 +808,10 @@ Object *object_resolve_path_type(const char *path, const char *typename,
>    *
>    * There is no way for a child to determine what its parent is.  It is not
>    * a bidirectional relationship.  This is by design.
> + *
> + * The value of a child property as a C string will be the child object's
> + * canonical path. It can be retrieved using object_property_get_str().
> + * The child object itself can be retrieved using object_property_get_link().
>    */
>   void object_property_add_child(Object *obj, const char *name,
>                                  Object *child, struct Error **errp);

Patch

diff --git a/include/qemu/object.h b/include/qemu/object.h
index ba2409d..d9e9221 100644
--- a/include/qemu/object.h
+++ b/include/qemu/object.h
@@ -808,6 +808,10 @@  Object *object_resolve_path_type(const char *path, const char *typename,
  *
  * There is no way for a child to determine what its parent is.  It is not
  * a bidirectional relationship.  This is by design.
+ *
+ * The value of a child property as a C string will be the child object's
+ * canonical path. It can be retrieved using object_property_get_str().
+ * The child object itself can be retrieved using object_property_get_link().
  */
 void object_property_add_child(Object *obj, const char *name,
                                Object *child, struct Error **errp);