aboutsummaryrefslogtreecommitdiff
path: root/qom
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-04-05 13:21:46 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2012-04-24 09:50:31 -0500
commitdfe47e7029e117f65a14c0948021654f7f7d5d05 (patch)
tree9831f047090bf7bb7c58959741aad546221cb862 /qom
parent7f3bf92fad79dff1edcb796a875b5c0d57666162 (diff)
downloadqemu-dfe47e7029e117f65a14c0948021654f7f7d5d05.zip
qemu-dfe47e7029e117f65a14c0948021654f7f7d5d05.tar.gz
qemu-dfe47e7029e117f65a14c0948021654f7f7d5d05.tar.bz2
qom: Refine container_get() to allow using a custom root
Specify the root to search from as argument. This avoids hardcoding "/machine" in some places and makes it more flexible. Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Anthony Liguori <anthony@codemonkey.ws> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qom')
-rw-r--r--qom/container.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/qom/container.c b/qom/container.c
index 67e9e8a..c9940ab 100644
--- a/qom/container.c
+++ b/qom/container.c
@@ -25,7 +25,7 @@ static void container_register_types(void)
type_register_static(&container_info);
}
-Object *container_get(const char *path)
+Object *container_get(Object *root, const char *path)
{
Object *obj, *child;
gchar **parts;
@@ -33,7 +33,7 @@ Object *container_get(const char *path)
parts = g_strsplit(path, "/", 0);
assert(parts != NULL && parts[0] != NULL && !parts[0][0]);
- obj = object_get_root();
+ obj = root;
for (i = 1; parts[i] != NULL; i++, obj = child) {
child = object_resolve_path_component(obj, parts[i]);