From f66dc8737c94a0ab57a252a280e5e83d6d630c67 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 13 Nov 2020 02:43:56 -0500 Subject: vl: move all generic initialization out of vl.c qdev_machine_creation_done is only setting a flag now. Extend it to move more code out of vl.c. Leave only consistency checks and gdbserver processing in qemu_machine_creation_done. gdbserver_start can be moved after qdev_machine_creation_done because it only does listen on the socket and creates some internal data structures; it does not send any data (e.g. guest state) over the socket. Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- hw/core/qdev.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'hw/core/qdev.c') diff --git a/hw/core/qdev.c b/hw/core/qdev.c index d3611e7c03..dddb0b2d69 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -404,7 +404,7 @@ void qdev_unrealize(DeviceState *dev) object_property_set_bool(OBJECT(dev), "realized", false, &error_abort); } -static int qdev_assert_realized_properly(Object *obj, void *opaque) +static int qdev_assert_realized_properly_cb(Object *obj, void *opaque) { DeviceState *dev = DEVICE(object_dynamic_cast(obj, TYPE_DEVICE)); DeviceClass *dc; @@ -417,16 +417,10 @@ static int qdev_assert_realized_properly(Object *obj, void *opaque) return 0; } -void qdev_machine_creation_done(void) +void qdev_assert_realized_properly(void) { - /* - * ok, initial machine setup is done, starting from now we can - * only create hotpluggable devices - */ - qdev_hotplug = true; - object_child_foreach_recursive(object_get_root(), - qdev_assert_realized_properly, NULL); + qdev_assert_realized_properly_cb, NULL); } bool qdev_machine_modified(void) -- cgit 1.4.1