summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorPaolo Bonzini2020-10-28 12:36:57 +0100
committerPaolo Bonzini2020-12-10 18:15:18 +0100
commit6b21670cfda76e47a827810eea5eb3b518cb6521 (patch)
treef04a2ea9e60db8497f7ea34e4613a3ec2d5610c1 /hw
parentvl: extract softmmu/datadir.c (diff)
downloadqemu-6b21670cfda76e47a827810eea5eb3b518cb6521.tar.gz
qemu-6b21670cfda76e47a827810eea5eb3b518cb6521.tar.xz
qemu-6b21670cfda76e47a827810eea5eb3b518cb6521.zip
vl: extract machine done notifiers
Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/core/machine.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 71a0e375ab..d7f8fdee45 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -1169,6 +1169,30 @@ void machine_run_board_init(MachineState *machine)
machine_class->init(machine);
}
+static NotifierList machine_init_done_notifiers =
+ NOTIFIER_LIST_INITIALIZER(machine_init_done_notifiers);
+
+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);
+ }
+}
+
+void qemu_remove_machine_init_done_notifier(Notifier *notify)
+{
+ notifier_remove(notify);
+}
+
+void qemu_run_machine_init_done_notifiers(void)
+{
+ machine_init_done = true;
+ notifier_list_notify(&machine_init_done_notifiers, NULL);
+}
+
static const TypeInfo machine_info = {
.name = TYPE_MACHINE,
.parent = TYPE_OBJECT,