summary refs log tree commit diff stats
path: root/stubs/qemu-timer-notify-cb.c
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2020-09-01 20:53:03 +0200
committerThomas Huth <thuth@redhat.com>2020-09-07 12:34:17 +0200
commitb0476d6602adbf818132dc896b585e01f47eaf96 (patch)
treec7bda200007283ff1b1740f1cc8ece69b656b93f /stubs/qemu-timer-notify-cb.c
parente7a222aeb813a06076f5a7b6c56c1b7301b40712 (diff)
downloadfocaccia-qemu-b0476d6602adbf818132dc896b585e01f47eaf96.tar.gz
focaccia-qemu-b0476d6602adbf818132dc896b585e01f47eaf96.zip
stubs: Move qemu_timer_notify_cb() and remove qemu_notify_event() stub
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>
Diffstat (limited to 'stubs/qemu-timer-notify-cb.c')
-rw-r--r--stubs/qemu-timer-notify-cb.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/stubs/qemu-timer-notify-cb.c b/stubs/qemu-timer-notify-cb.c
new file mode 100644
index 0000000000..054b408b1c
--- /dev/null
+++ b/stubs/qemu-timer-notify-cb.c
@@ -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();
+}