[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 10/69] vl: export machine_init_done
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 10/69] vl: export machine_init_done |
Date: |
Tue, 13 Mar 2018 23:46:20 +0100 |
From: Peter Xu <address@hidden>
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 <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Daniel P. Berrangé <address@hidden>
Acked-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
include/sysemu/sysemu.h | 2 ++
stubs/machine-init-done.c | 2 ++
vl.c | 4 ++--
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 356bfdc1c1..2b42151c63 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -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);
diff --git a/stubs/machine-init-done.c b/stubs/machine-init-done.c
index 9a0d62514f..4121f1709b 100644
--- a/stubs/machine-init-done.c
+++ b/stubs/machine-init-done.c
@@ -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 3ef04ce991..26662eb9e7 100644
--- 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,
--
2.14.3
- [Qemu-devel] [PULL 00/69] Misc patches for QEMU soft freeze, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 05/69] qemu-doc: update deprecation section to use -nic and -netdev hubport, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 01/69] qom: introduce object_class_get_list_sorted, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 03/69] q35: change default NIC to e1000e, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 04/69] scsi-disk.c: consider bl->max_transfer in INQUIRY emulation, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 06/69] qemu-doc: Add the paragraph about the -no-frame deprecation again, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 07/69] build-sys: make help could have 'modules' target, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 02/69] net: allow using any PCI NICs in -net or -nic, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 09/69] checkpatch: Exempt long URLs, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 11/69] chardev: fix handling of EAGAIN for TCP chardev, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 10/69] vl: export machine_init_done,
Paolo Bonzini <=
- [Qemu-devel] [PULL 08/69] hw: Do not include "sysemu/block-backend.h" if it is not necessary, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 13/69] chardev: allow telnet gsource to switch gcontext, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 15/69] chardev: use chardev's gcontext for async connect, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 12/69] chardev: update net listener gcontext, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 14/69] chardev: introduce chr_machine_done hook, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 16/69] chardev: tcp: postpone async connection setup, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 19/69] hw/i386: make IOMMUs configurable via default-configs/, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 18/69] scsi: support NDOB (no data-out buffer) for WRITE SAME commands, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 22/69] rcutorture: remove synchronize_rcu from readers, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 21/69] hw/mips/jazz: Fix implicit creation of "-drive if=scsi" devices, Paolo Bonzini, 2018/03/13