summaryrefslogtreecommitdiffstats
path: root/qom
diff options
context:
space:
mode:
Diffstat (limited to 'qom')
-rw-r--r--qom/object.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/qom/object.c b/qom/object.c
index 6be710bc40..4f0677cca9 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -2144,6 +2144,17 @@ Object *object_resolve_path(const char *path, bool *ambiguous)
return object_resolve_path_type(path, TYPE_OBJECT, ambiguous);
}
+Object *object_resolve_path_at(Object *parent, const char *path)
+{
+ g_auto(GStrv) parts = g_strsplit(path, "/", 0);
+
+ if (*path == '/') {
+ return object_resolve_abs_path(object_get_root(), parts + 1,
+ TYPE_OBJECT);
+ }
+ return object_resolve_abs_path(parent, parts, TYPE_OBJECT);
+}
+
typedef struct StringProperty
{
char *(*get)(Object *, Error **);