@@ -1048,6 +1048,22 @@ Object *object_resolve_path_type(const char *path, const char *typename,
Object *object_resolve_path_component(Object *parent, const gchar *part);
/**
+ * object_resolve_link:
+ * @obj: The object containing the link property
+ * @name: Name of the link property
+ * @path: the path to resolve
+ * @errp: Error object to populate in case of error
+ *
+ * Lookup an object and ensure its type matches a link property type. This
+ * is similar to object_resolve_path() except type verification against the
+ * link property is performed.
+ *
+ * Returns: The matched object or NULL on path lookup failures.
+ */
+Object *object_resolve_link(Object *obj, const char *name,
+ const char *path, Error **errp);
+
+/**
* object_property_add_child:
* @obj: the object to add a property to
* @name: the name of the property
@@ -1058,17 +1058,8 @@ static void object_get_link_property(Object *obj, Visitor *v, void *opaque,
}
}
-/*
- * object_resolve_link:
- *
- * Lookup an object and ensure its type matches the link property type. This
- * is similar to object_resolve_path() except type verification against the
- * link property is performed.
- *
- * Returns: The matched object or NULL on path lookup failures.
- */
-static Object *object_resolve_link(Object *obj, const char *name,
- const char *path, Error **errp)
+Object *object_resolve_link(Object *obj, const char *name,
+ const char *path, Error **errp)
{
const char *type;
gchar *target_type;
The lower level API object_resolve_path is already published to the world as part of the QOM API. Add object_resolve link as well. This allows QOM clients to roll their own link property setters without having to fallback to the less safe object_resolve_path. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> --- include/qom/object.h | 16 ++++++++++++++++ qom/object.c | 13 ++----------- 2 files changed, 18 insertions(+), 11 deletions(-)