diff mbox series

[6/7] stubs: Split machine-init-done as machine-init and machine-notify

Message ID 20200423202112.644-7-philmd@redhat.com
State New
Headers show
Series chardev: Reduce system emulation specific code | expand

Commit Message

Philippe Mathieu-Daudé April 23, 2020, 8:21 p.m. UTC
As the machine notify handlers are only used in system emulation,
split the current file in two, and only build the notifier when
system emulation is used.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 stubs/machine-init.c                            | 4 ++++
 stubs/{machine-init-done.c => machine-notify.c} | 2 --
 stubs/Makefile.objs                             | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)
 create mode 100644 stubs/machine-init.c
 rename stubs/{machine-init-done.c => machine-notify.c} (78%)
diff mbox series

Patch

diff --git a/stubs/machine-init.c b/stubs/machine-init.c
new file mode 100644
index 0000000000..7622930ee0
--- /dev/null
+++ b/stubs/machine-init.c
@@ -0,0 +1,4 @@ 
+#include "qemu/osdep.h"
+#include "sysemu/sysemu.h"
+
+bool machine_init_done = true;
diff --git a/stubs/machine-init-done.c b/stubs/machine-notify.c
similarity index 78%
rename from stubs/machine-init-done.c
rename to stubs/machine-notify.c
index cd8e81392d..d164ecccb9 100644
--- a/stubs/machine-init-done.c
+++ b/stubs/machine-notify.c
@@ -1,8 +1,6 @@ 
 #include "qemu/osdep.h"
 #include "sysemu/sysemu.h"
 
-bool machine_init_done = true;
-
 void qemu_add_machine_init_done_notifier(Notifier *notify)
 {
 }
diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index 45be5dc0ed..765659a3f9 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -15,7 +15,8 @@  stub-obj-y += iothread-lock.o
 stub-obj-y += is-daemonized.o
 stub-obj-$(CONFIG_LINUX_AIO) += linux-aio.o
 stub-obj-$(CONFIG_LINUX_IO_URING) += io_uring.o
-stub-obj-y += machine-init-done.o
+stub-obj-y += machine-init.o
+stub-obj-$(CONFIG_SOFTMMU) += machine-notify.o
 stub-obj-y += migr-blocker.o
 stub-obj-y += change-state-handler.o
 stub-obj-y += monitor.o