Add object_property_get_opaque() to get opaque property in ObjectProperty. Signed-off-by: Zhu Guihua <zhugh.f...@cn.fujitsu.com> --- include/qom/object.h | 1 + qom/object.c | 9 +++++++++ 2 files changed, 10 insertions(+)
diff --git a/include/qom/object.h b/include/qom/object.h index 8a05a81..5d55889 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1300,5 +1300,6 @@ int object_child_foreach(Object *obj, int (*fn)(Object *child, void *opaque), */ Object *container_get(Object *root, const char *path); +void *object_property_get_opaque(ObjectProperty *prop, Error **errp); #endif diff --git a/qom/object.c b/qom/object.c index da0919a..00a25e0 100644 --- a/qom/object.c +++ b/qom/object.c @@ -356,6 +356,15 @@ static inline bool object_property_is_child(ObjectProperty *prop) return strstart(prop->type, "child<", NULL); } +void *object_property_get_opaque(ObjectProperty *prop, Error **errp) +{ + if (prop == NULL) { + return NULL; + } + + return prop->opaque; +} + static void object_property_del_all(Object *obj) { while (!QTAILQ_EMPTY(&obj->properties)) { -- 1.9.3