stubs: Move qemu_timer_notify_cb() and remove qemu_notify_event() stub
authorThomas Huth <thuth@redhat.com>
Tue, 1 Sep 2020 18:53:03 +0000 (20:53 +0200)
committerThomas Huth <thuth@redhat.com>
Mon, 7 Sep 2020 10:34:17 +0000 (12:34 +0200)
When cross-compiling with MinGW, there are sometimes some weird linker
errors like:

ibqemuutil.a(util_main-loop.c.obj): In function `qemu_notify_event':
/builds/huth/qemu/build/../util/main-loop.c:139: multiple definition of
 `qemu_notify_event'
libqemuutil.a(stubs_notify-event.c.obj):/builds/huth/qemu/stubs/notify-event.c:5:
 first defined here
collect2: error: ld returned 1 exit status
/builds/huth/qemu/rules.mak:88: recipe for target 'tests/test-timed-average.exe'
 failed

It seems like it works better when the qemu_timer_notify_cb() stub (which
calls qemu_notify_event()) is in a separate file - then we can also even
remove the qemu_notify_event() stub now.

This patch is based on ideas from the patch "stubs: Remove qemu_notify_event()"
by Philippe Mathieu-Daudé and the patch "cpu-timers, icount: new modules" from
Claudio Fontana.

Message-Id: <20200902102433.304737-1-thuth@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
stubs/cpu-get-icount.c
stubs/meson.build
stubs/notify-event.c [deleted file]
stubs/qemu-timer-notify-cb.c [new file with mode: 0644]

index b35f84463861d20cd433208b7918394642d918cd..40016132409399f35c78e6b0cc07b03f3fe71dc0 100644 (file)
@@ -14,8 +14,3 @@ int64_t cpu_get_icount_raw(void)
 {
     abort();
 }
-
-void qemu_timer_notify_cb(void *opaque, QEMUClockType type)
-{
-    qemu_notify_event();
-}
index 019bd79c7a263a2dcf5cfad47f4d04d0c0f4d84c..e2dfedc2a79ed76ebe39d8165fee4b3d74de2545 100644 (file)
@@ -24,9 +24,9 @@ stub_ss.add(files('machine-init-done.c'))
 stub_ss.add(files('migr-blocker.c'))
 stub_ss.add(files('monitor.c'))
 stub_ss.add(files('monitor-core.c'))
-stub_ss.add(files('notify-event.c'))
 stub_ss.add(files('pci-bus.c'))
 stub_ss.add(files('pci-host-piix.c'))
+stub_ss.add(files('qemu-timer-notify-cb.c'))
 stub_ss.add(files('qmp_memory_device.c'))
 stub_ss.add(files('qtest.c'))
 stub_ss.add(files('ram-block.c'))
diff --git a/stubs/notify-event.c b/stubs/notify-event.c
deleted file mode 100644 (file)
index 827bb52..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "qemu/osdep.h"
-#include "qemu/main-loop.h"
-
-void qemu_notify_event(void)
-{
-}
diff --git a/stubs/qemu-timer-notify-cb.c b/stubs/qemu-timer-notify-cb.c
new file mode 100644 (file)
index 0000000..054b408
--- /dev/null
@@ -0,0 +1,8 @@
+#include "qemu/osdep.h"
+#include "sysemu/cpus.h"
+#include "qemu/main-loop.h"
+
+void qemu_timer_notify_cb(void *opaque, QEMUClockType type)
+{
+    qemu_notify_event();
+}