diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2012-03-28 16:34:12 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-04-02 15:04:15 -0500 |
commit | f05f6b4adb4db3affb0cdd17383b0a7e905e66e1 (patch) | |
tree | c95bfd1b99970b8cf0b3ac8aa3a7635fe19924d3 /hw/qdev.c | |
parent | da57febfed7bad11be79f047b59719c38abd0712 (diff) |
qdev: put all devices under /machine
Avoid cluttering too much the QOM root.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/qdev.c')
-rw-r--r-- | hw/qdev.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -157,7 +157,7 @@ int qdev_init(DeviceState *dev) static int unattached_count = 0; gchar *name = g_strdup_printf("device[%d]", unattached_count++); - object_property_add_child(container_get("/unattached"), name, + object_property_add_child(container_get("/machine/unattached"), name, OBJECT(dev), NULL); g_free(name); } @@ -668,6 +668,17 @@ void device_reset(DeviceState *dev) } } +Object *qdev_get_machine(void) +{ + static Object *dev; + + if (dev == NULL) { + dev = container_get("/machine"); + } + + return dev; +} + static TypeInfo device_type_info = { .name = TYPE_DEVICE, .parent = TYPE_OBJECT, |