aboutsummaryrefslogtreecommitdiff
path: root/softmmu/vl.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-11-12 09:38:36 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2020-12-15 12:51:52 -0500
commit2f181fbd5a9d456d1da291bea61d7e3ad10ec7d1 (patch)
treef6be4e559a9b9a95a2870caf0fc323e7ca6778e7 /softmmu/vl.c
parent5a1ee6077b89ee9a803aaf8d1c98004701f63684 (diff)
machine: introduce MachineInitPhase
Generalize the qdev_hotplug variable to the different phases of machine initialization. We would like to allow different monitor commands depending on the phase. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'softmmu/vl.c')
-rw-r--r--softmmu/vl.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 8e18c52f6e..4fece1b9db 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -2406,10 +2406,6 @@ static void qemu_init_displays(void)
}
}
-/*
- * Called after leaving preconfig state. From here on runstate is
- * RUN_STATE_PRELAUNCH or RUN_STATE_INMIGRATE.
- */
static void qemu_init_board(void)
{
MachineClass *machine_class = MACHINE_GET_CLASS(current_machine);
@@ -2424,6 +2420,7 @@ static void qemu_init_board(void)
exit(1);
}
+ /* From here on we enter MACHINE_PHASE_INITIALIZED. */
machine_run_board_init(current_machine);
/*
@@ -2490,7 +2487,7 @@ static void qemu_machine_creation_done(void)
void qmp_x_exit_preconfig(Error **errp)
{
- if (qdev_hotplug) {
+ if (phase_check(PHASE_MACHINE_INITIALIZED)) {
error_setg(errp, "The command is permitted only before machine initialization");
return;
}
@@ -3469,12 +3466,14 @@ void qemu_init(int argc, char **argv, char **envp)
qemu_create_early_backends();
qemu_apply_machine_options();
+ phase_advance(PHASE_MACHINE_CREATED);
/*
* Note: uses machine properties such as kernel-irqchip, must run
* after machine_set_property().
*/
configure_accelerators(argv[0]);
+ phase_advance(PHASE_ACCEL_CREATED);
/*
* Beware, QOM objects created before this point miss global and