diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2015-03-31 14:01:06 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-06-05 17:36:39 +0200 |
commit | 71cdd1cb914e24000273bbbfa5fb226cdb8ea265 (patch) | |
tree | da93a37f5a23553078af563b5fb02b9c144d009d /vl.c | |
parent | fb9e7e334b54350e8e3b62bd7892b78f63a9d848 (diff) |
vl: run "late" notifiers immediately
If a machine_init_done notifier is added late, as part of a hot-plugged
device, run it immediately.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -2500,14 +2500,20 @@ static void qemu_run_exit_notifiers(void) notifier_list_notify(&exit_notifiers, NULL); } +static bool machine_init_done; + void qemu_add_machine_init_done_notifier(Notifier *notify) { notifier_list_add(&machine_init_done_notifiers, notify); + if (machine_init_done) { + notify->notify(notify, NULL); + } } static void qemu_run_machine_init_done_notifiers(void) { notifier_list_notify(&machine_init_done_notifiers, NULL); + machine_init_done = true; } static const QEMUOption *lookup_opt(int argc, char **argv, |