From a612b2a6635fa1a3a29a8bcf41b31f1f3fae1110 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 27 Mar 2012 18:38:45 +0200 Subject: qom: add container_get This is QOM "mkdir -p". It is useful when referring to container objects such as "/machine". Reviewed-by: Anthony Liguori Signed-off-by: Paolo Bonzini Signed-off-by: Anthony Liguori --- hw/qdev-monitor.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'hw') diff --git a/hw/qdev-monitor.c b/hw/qdev-monitor.c index a310cc7..2e82962 100644 --- a/hw/qdev-monitor.c +++ b/hw/qdev-monitor.c @@ -180,9 +180,7 @@ static Object *qdev_get_peripheral(void) static Object *dev; if (dev == NULL) { - dev = object_new("container"); - object_property_add_child(object_get_root(), "peripheral", - OBJECT(dev), NULL); + dev = container_get("/peripheral"); } return dev; @@ -193,9 +191,7 @@ static Object *qdev_get_peripheral_anon(void) static Object *dev; if (dev == NULL) { - dev = object_new("container"); - object_property_add_child(object_get_root(), "peripheral-anon", - OBJECT(dev), NULL); + dev = container_get("/peripheral-anon"); } return dev; -- cgit v1.1