chardev: do not use machine_init_done

machine_init_done is not the right flag to check when preconfig
is taken into account; for example "./qemu-system-x86_64 -serial
mon:stdio -preconfig" does not print the QEMU monitor header until after
exit_preconfig.  Add back a custom bool for mux character devices.  This
partially undoes commit c7278b4355 ("chardev: introduce chr_machine_done
hook", 2018-03-12), but it keeps the cleaner logic using a function
pointer in ChardevClass.

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2020-11-30 13:44:49 -05:00
parent f66dc8737c
commit 5a1ee6077b
9 changed files with 43 additions and 88 deletions

View file

@ -1179,7 +1179,7 @@ void machine_run_board_init(MachineState *machine)
static NotifierList machine_init_done_notifiers =
NOTIFIER_LIST_INITIALIZER(machine_init_done_notifiers);
bool machine_init_done;
static bool machine_init_done;
void qemu_add_machine_init_done_notifier(Notifier *notify)
{