Skip to contentSkip to conversation

qom: add object_child_foreach

PATCH Andreas Färber 1 participant 1 message May 11, 2012 3 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

Andreas Färber

author Reviewed-by Anthony Liguori Applied
#3 lore raw

Am 12.04.2012 18:03, schrieb Andreas Färber:

Quoted 4 lines

Am 11.04.2012 23:30, schrieb Paolo Bonzini:

Quoted 3 lines

A utility function that will be used to implement hierarchical realization.

Quoted 12 lines
Quoted 12 lines
---
 include/qemu/object.h |   14 +++++++++++++-
 qom/object.c          |   17 +++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)
include/qemu/object.h +0 -0
index f814521..470efe3 100644
@@ -918,6 +918,19 @@ void object_property_add_str(Object *obj, const char *name,
                              struct Error **errp);
 
Quoted 9 lines

include/qemu/object.h void object_property_add_str(Object *obj, const char *name, · line 928

Quoted 9 lines
include/qemu/object.h +8 -0
 /**
+ * object_child_foreach:
+ * @obj: the object whose children will be navigated
+ * @fn: the iterator function to be called
+ * @opaque: an opaque value that will be passed to the iterator
+ *
+ * Call @fn passing each child of @obj and @opaque to it, until @fn returns
+ * non-zero.  Return the last value returned by @fn, or 0 if there is no
+ * child.

I've turned the last sentence into a gtk-doc Returns: statement.

Quoted 12 lines
Quoted 12 lines
include/qemu/object.h +5 -0
+ */
+int object_child_foreach(Object *obj, int (*fn)(Object *child, void *opaque),
+                         void *opaque);
+
+/**
  * container_get:
  * @path: path to the container
  *
@@ -928,5 +941,4 @@ void object_property_add_str(Object *obj, const char *name,
  */
 Object *container_get(const char *path);
 
Quoted 3 lines

include/qemu/object.h void object_property_add_str(Object *obj, const char *name, · line 931

Quoted 1 line
include/qemu/object.h +0 -1
-

Unrelated whitespace change.

Thanks, applied to qom-next (with whitespace change dropped):
http://repo.or.cz/w/qemu/afaerber.git/shortlog/refs/heads/qom-next

/-F

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg