@@ -1562,6 +1562,21 @@ Object *object_resolve_path_type(const char *path, const char *typename,
*/
Object *object_resolve_path_at(Object *parent, const char *path);
+/**
+ * object_resolve_path_from:
+ * @parent: the object from which to resolve the path
+ * @path: the path to resolve
+ * @ambiguous: returns true if the path resolution failed because of an
+ * ambiguous match
+ *
+ * This is like object_resolve_path_at(), except @parent may be the
+ * partial parent of @path.
+ *
+ * Returns: The resolved object or NULL on path lookup failure.
+ */
+Object *object_resolve_path_from(Object *parent, const char *path,
+ bool *ambiguous);
+
/**
* object_resolve_path_component:
* @parent: the object in which to resolve the path
@@ -2192,6 +2192,24 @@ Object *object_resolve_path_at(Object *parent, const char *path)
return object_resolve_abs_path(parent, parts, TYPE_OBJECT);
}
+Object *object_resolve_path_from(Object *parent, const char *path,
+ bool *ambiguousp)
+{
+ g_auto(GStrv) parts = NULL;
+ bool ambiguous = false;
+ Object *obj;
+
+ parts = g_strsplit(path, "/", 0);
+ assert(parts);
+
+ obj = object_resolve_partial_path(parent, parts, TYPE_OBJECT,
+ &ambiguous);
+ if (ambiguousp) {
+ *ambiguousp = ambiguous;
+ }
+ return obj;
+}
+
typedef struct StringProperty
{
char *(*get)(Object *, Error **);