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>
This commit is contained in:
Paolo Bonzini 2020-11-12 09:38:36 -05:00
parent 5a1ee6077b
commit 2f181fbd5a
11 changed files with 73 additions and 32 deletions

View file

@ -1345,7 +1345,7 @@ static QemuConsole *new_console(DisplayState *ds, console_type_t console_type,
if (QTAILQ_EMPTY(&consoles)) {
s->index = 0;
QTAILQ_INSERT_TAIL(&consoles, s, next);
} else if (console_type != GRAPHIC_CONSOLE || qdev_hotplug) {
} else if (console_type != GRAPHIC_CONSOLE || phase_check(PHASE_MACHINE_READY)) {
QemuConsole *last = QTAILQ_LAST(&consoles);
s->index = last->index + 1;
QTAILQ_INSERT_TAIL(&consoles, s, next);