diff options
Diffstat (limited to 'qom/object.c')
-rw-r--r-- | qom/object.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/qom/object.c b/qom/object.c index 105c649e8d..7a70d52e3a 100644 --- a/qom/object.c +++ b/qom/object.c @@ -607,6 +607,23 @@ void object_class_foreach(void (*fn)(ObjectClass *klass, void *opaque), g_hash_table_foreach(type_table_get(), object_class_foreach_tramp, &data); } +int object_child_foreach(Object *obj, int (*fn)(Object *child, void *opaque), + void *opaque) +{ + ObjectProperty *prop; + int ret = 0; + + QTAILQ_FOREACH(prop, &obj->properties, node) { + if (object_property_is_child(prop)) { + ret = fn(prop->opaque, opaque); + if (ret != 0) { + break; + } + } + } + return ret; +} + static void object_class_get_list_tramp(ObjectClass *klass, void *opaque) { GSList **list = opaque; |