aboutsummaryrefslogtreecommitdiff
path: root/hw
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 /hw
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 'hw')
-rw-r--r--hw/qdev-monitor.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/hw/qdev-monitor.c b/hw/qdev-monitor.c
index a310cc7b16..2e82962fc3 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;