diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2020-11-13 02:43:56 -0500 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-12-15 12:51:50 -0500 |
commit | f66dc8737c94a0ab57a252a280e5e83d6d630c67 (patch) | |
tree | ae8c484120ab9f38bbf65a8be010cbf816b26ecc /softmmu | |
parent | c5e3c9182d0cc312196aa5e1de305e9ab5a7cda3 (diff) |
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 <imammedo@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'softmmu')
-rw-r--r-- | softmmu/vl.c | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/softmmu/vl.c b/softmmu/vl.c index 685d92df5d..d8af26c281 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -72,7 +72,6 @@ #include "hw/i386/pc.h" #include "migration/misc.h" #include "migration/snapshot.h" -#include "migration/global_state.h" #include "sysemu/tpm.h" #include "sysemu/dma.h" #include "hw/audio/soundhw.h" @@ -2465,8 +2464,6 @@ static void qemu_create_cli_devices(void) static void qemu_machine_creation_done(void) { - cpu_synchronize_all_post_init(); - /* Did we create any drives that we failed to create a device for? */ drive_check_orphaned(); @@ -2484,43 +2481,11 @@ static void qemu_machine_creation_done(void) qdev_prop_check_globals(); - if (current_machine->boot_once) { - qemu_boot_set(current_machine->boot_once, &error_fatal); - qemu_register_reset(restore_boot_order, g_strdup(current_machine->boot_order)); - } - - if (foreach_device_config(DEV_GDB, gdbserver_start) < 0) { - exit(1); - } - qdev_machine_creation_done(); - /* TODO: once all bus devices are qdevified, this should be done - * when bus is created by qdev.c */ - /* - * TODO: If we had a main 'reset container' that the whole system - * lived in, we could reset that using the multi-phase reset - * APIs. For the moment, we just reset the sysbus, which will cause - * all devices hanging off it (and all their child buses, recursively) - * to be reset. Note that this will *not* reset any Device objects - * which are not attached to some part of the qbus tree! - */ - qemu_register_reset(resettable_cold_reset_fn, sysbus_get_default()); - qemu_run_machine_init_done_notifiers(); - - if (rom_check_and_register_reset() != 0) { - error_report("rom check and register reset failed"); + if (foreach_device_config(DEV_GDB, gdbserver_start) < 0) { exit(1); } - - replay_start(); - - /* This checkpoint is required by replay to separate prior clock - reading from the other reads, because timer polling functions query - clock values from the log. */ - replay_checkpoint(CHECKPOINT_RESET); - qemu_system_reset(SHUTDOWN_CAUSE_NONE); - register_global_state(); } void qmp_x_exit_preconfig(Error **errp) |