aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-03-27 18:38:45 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2012-04-02 15:04:15 -0500
commita612b2a6635fa1a3a29a8bcf41b31f1f3fae1110 (patch)
treead67b1ac99f0ba0a9fc8ba49b6cad26b186f0401 /include
parentcefc898806e0346eef87d15ddaac9475b57b7d84 (diff)
qom: add container_get
This is QOM "mkdir -p". It is useful when referring to container objects such as "/machine". Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'include')
-rw-r--r--include/qemu/object.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/qemu/object.h b/include/qemu/object.h
index e8fc1268b3..a675937da1 100644
--- a/include/qemu/object.h
+++ b/include/qemu/object.h
@@ -837,6 +837,18 @@ Object *object_resolve_path_type(const char *path, const char *typename,
bool *ambiguous);
/**
+ * object_resolve_path_component:
+ * @parent: the object in which to resolve the path
+ * @part: the component to resolve.
+ *
+ * This is similar to object_resolve_path with an absolute path, but it
+ * only resolves one element (@part) and takes the others from @parent.
+ *
+ * Returns: The resolved object or NULL on path lookup failure.
+ */
+Object *object_resolve_path_component(Object *parent, gchar *part);
+
+/**
* object_property_add_child:
* @obj: the object to add a property to
* @name: the name of the property
@@ -891,4 +903,16 @@ void object_property_add_str(Object *obj, const char *name,
void (*set)(Object *, const char *, struct Error **),
struct Error **errp);
+/**
+ * container_get:
+ * @path: path to the container
+ *
+ * Return a container object whose path is @path. Create more containers
+ * along the path if necessary.
+ *
+ * Returns: the container object.
+ */
+Object *container_get(const char *path);
+
+
#endif