]> Git Repo - qemu.git/commitdiff
vl: export machine_init_done
authorPeter Xu <[email protected]>
Tue, 6 Mar 2018 05:33:12 +0000 (13:33 +0800)
committerPaolo Bonzini <[email protected]>
Mon, 12 Mar 2018 15:12:46 +0000 (16:12 +0100)
We have that variable but not exported.  Export that so modules can have
a way to poke on whether machine init has finished.

Meanwhile, set that up even before calling the notifiers, so that
notifiers who may depend on this field will get a correct answer.

Suggested-by: Paolo Bonzini <[email protected]>
Reviewed-by: Marc-AndrĂ© Lureau <[email protected]>
Signed-off-by: Peter Xu <[email protected]>
Message-Id: <20180306053320[email protected]>
Reviewed-by: Daniel P. BerrangĂ© <[email protected]>
Acked-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
include/sysemu/sysemu.h
stubs/machine-init-done.c
vl.c

index 356bfdc1c1cfe6eb35d34600373a49c244afeeb1..2b42151c6300dcc851bd32d8a8c3e87735c884b9 100644 (file)
@@ -88,6 +88,8 @@ void qemu_system_guest_panicked(GuestPanicInformation *info);
 void qemu_add_exit_notifier(Notifier *notify);
 void qemu_remove_exit_notifier(Notifier *notify);
 
+extern bool machine_init_done;
+
 void qemu_add_machine_init_done_notifier(Notifier *notify);
 void qemu_remove_machine_init_done_notifier(Notifier *notify);
 
index 9a0d62514fb40f9acd5244ed6250622d05a5701c..4121f1709b504f366c772499873a0f5d1186dccf 100644 (file)
@@ -2,6 +2,8 @@
 #include "qemu-common.h"
 #include "sysemu/sysemu.h"
 
+bool machine_init_done = true;
+
 void qemu_add_machine_init_done_notifier(Notifier *notify)
 {
 }
diff --git a/vl.c b/vl.c
index 3ef04ce991fee332ca2faf883114dda6fb87d419..26662eb9e7682404ac6815722d7e2f7831cd328c 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -2696,7 +2696,7 @@ static void qemu_run_exit_notifiers(void)
     notifier_list_notify(&exit_notifiers, NULL);
 }
 
-static bool machine_init_done;
+bool machine_init_done;
 
 void qemu_add_machine_init_done_notifier(Notifier *notify)
 {
@@ -2713,8 +2713,8 @@ void qemu_remove_machine_init_done_notifier(Notifier *notify)
 
 static void qemu_run_machine_init_done_notifiers(void)
 {
-    notifier_list_notify(&machine_init_done_notifiers, NULL);
     machine_init_done = true;
+    notifier_list_notify(&machine_init_done_notifiers, NULL);
 }
 
 static const QEMUOption *lookup_opt(int argc, char **argv,
This page took 0.033392 seconds and 4 git commands to generate.