提交 71cdd1cb 编写于 作者: P Paolo Bonzini

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: NPaolo Bonzini <pbonzini@redhat.com>
上级 fb9e7e33
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册