aboutsummaryrefslogtreecommitdiff
path: root/hw/qdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/qdev.c')
-rw-r--r--hw/qdev.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/hw/qdev.c b/hw/qdev.c
index 6f77af91ef..bb0b9f7d6a 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -1161,3 +1161,15 @@ void qdev_property_add_legacy(DeviceState *dev, Property *prop,
g_free(type);
}
+
+DeviceState *qdev_get_root(void)
+{
+ static DeviceState *qdev_root;
+
+ if (!qdev_root) {
+ qdev_root = qdev_create(NULL, "container");
+ qdev_init_nofail(qdev_root);
+ }
+
+ return qdev_root;
+}