From: Ruslan Ruslichenko <[email protected]> Export `object_resovle_link()` for use by other subsystems.
This allow callers to resolve object path and verify type contrains of a link property. Signed-off-by: Ruslan Ruslichenko <[email protected]> --- include/qom/object.h | 12 ++++++++++++ qom/object.c | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/qom/object.h b/include/qom/object.h index 26df6137b9..1573d41d4f 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -2034,6 +2034,18 @@ int object_child_foreach_recursive(Object *obj, */ Object *object_property_add_new_container(Object *obj, const char *name); +/* + * 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. + */ +Object *object_resolve_link(Object *obj, const char *name, + const char *path, Error **errp); + /** * object_property_help: * @name: the name of the property diff --git a/qom/object.c b/qom/object.c index ff8ede8a32..7e16765cb4 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1904,7 +1904,7 @@ static void object_get_link_property(Object *obj, Visitor *v, * * Returns: The matched object or NULL on path lookup failures. */ -static Object *object_resolve_link(Object *obj, const char *name, +Object *object_resolve_link(Object *obj, const char *name, const char *path, Error **errp) { const char *type; -- 2.43.0
