qdev: fix hotplug when no -device is specified
The peripheral[-anon] containers are initialized lazily but since they sit on
sysbus, they can not be created after realize. This was causing an abort() to
occur during hotplug if no -device option was used.
This was spotted by qemu-test::device-add.sh
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
diff --git a/vl.c b/vl.c
index da69f94..78b790c 100644
--- a/vl.c
+++ b/vl.c
@@ -3335,6 +3335,8 @@
}
qemu_add_globals();
+ qdev_machine_init();
+
machine->init(ram_size, boot_devices,
kernel_filename, kernel_cmdline, initrd_filename, cpu_model);