qemu-e2k/softmmu
Akihiko Odaki bab6a301c5 ui/cocoa: Run qemu_init in the main thread
This work is based on:
https://patchew.org/QEMU/20220317125534.38706-1-philippe.mathieu.daude@gmail.com/

Simplify the initialization dance by running qemu_init() in the main
thread before the Cocoa event loop starts. The secondary thread only
runs only qemu_main_loop() and qemu_cleanup().

This fixes a case where addRemovableDevicesMenuItems() calls
qmp_query_block() while expecting the main thread to still hold
the BQL.

Overriding the code after calling qemu_init() is done by dynamically
replacing a function pointer variable, qemu_main when initializing
ui/cocoa, which unifies the static implementation of main() for
builds with ui/cocoa and ones without ui/cocoa.

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Message-Id: <20220819132756.74641-2-akihiko.odaki@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-09-23 14:36:33 +02:00
..
arch_init.c softmmu: Add qemu_init_arch_modules() 2022-03-06 13:15:42 +01:00
balloon.c
bootdevice.c machine: use QAPI struct for boot configuration 2022-05-12 12:29:43 +02:00
cpu-throttle.c Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
cpu-timers.c Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
cpus.c whpx: Added support for breakpoints and stepping 2022-04-06 14:31:55 +02:00
datadir.c meson: Prefix each element of firmware path 2022-07-13 16:58:57 +02:00
device_tree.c softmmu/device_tree: Remove redundant pointer assignment 2022-01-21 15:52:56 +10:00
dirtylimit.c softmmu/dirtylimit: Implement dirty page rate limit 2022-07-20 12:15:08 +01:00
dma-helpers.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
globals.c ui: Switch "-display sdl" to use the QAPI parser 2022-06-03 08:03:28 +02:00
icount.c replay: rewrite async event handling 2022-06-06 09:26:53 +02:00
ioport.c
main.c ui/cocoa: Run qemu_init in the main thread 2022-09-23 14:36:33 +02:00
memory.c Replace TARGET_WORDS_BIGENDIAN 2022-04-06 10:50:37 +02:00
memory_mapping.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
meson.build softmmu/dirtylimit: Implement vCPU dirtyrate calculation periodically 2022-07-20 12:15:08 +01:00
physmem.c accel/tcg: Move qemu_ram_addr_from_host_nofail to physmem.c 2022-09-06 08:04:26 +01:00
qdev-monitor.c qdev: unplug blocker for devices 2022-06-15 14:50:41 +01:00
qemu-seccomp.c seccomp: block setns, unshare and execveat syscalls 2022-02-16 18:52:40 +00:00
qtest.c Replace TARGET_WORDS_BIGENDIAN 2022-04-06 10:50:37 +02:00
rtc.c rtc: Move RTC function prototypes to their own header 2022-01-28 14:29:46 +00:00
runstate-action.c
runstate.c qapi: Add exit-failure PanicAction 2022-07-29 09:48:01 +01:00
timers-state.h
tpm.c
trace-events softmmu/dirtylimit: Implement virtual CPU throttle 2022-07-20 12:15:08 +01:00
trace.h
vl.c ui/cocoa: Run qemu_init in the main thread 2022-09-23 14:36:33 +02:00