Skip to contentSkip to conversation

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

PATCH Applied [email protected] 3 participants 3 messages Feb 21, 2012 – Feb 22, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qom: Document ways to retrieve child object added by object_property_add_child()

From: Alexander Barabash <[email protected]>

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

---
 include/qemu/object.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
include/qemu/object.h +4 -0
index ba2409d..d9e9221 100644
@@ -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);
Signature · 1 line
1.7.5.4
Acked-by on v1 1/1
#1 lore raw
Quoted 15 lines · On 02/21/2012 11:14 AM, [email protected] wrote:

From: Alexander Barabash <[email protected]>

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

---
 include/qemu/object.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
include/qemu/object.h +0 -0
index ba2409d..d9e9221 100644

include/qemu/object.h Object *object_resolve_path_type(const char *path, const char *typename, · line 817

Quoted 10 lines
include/qemu/object.h +4 -0
@@ -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);
#2 lore raw
In reply to [email protected]
Quoted 6 lines · On 02/21/2012 04:14 AM, [email protected] wrote:

From: Alexander Barabash<[email protected]>

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

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 19 lines
---
  include/qemu/object.h |    4 ++++
  1 files changed, 4 insertions(+), 0 deletions(-)
include/qemu/object.h +4 -0
index ba2409d..d9e9221 100644
@@ -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);