@@ -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
@@ -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)) {
Add object_property_get_opaque() to get opaque property in ObjectProperty. Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com> --- include/qom/object.h | 1 + qom/object.c | 9 +++++++++ 2 files changed, 10 insertions(+)