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
..
2020-09-30 19:09:19 +02:00
2019-03-11 08:39:02 +01:00
2021-12-21 10:50:22 +04:00
2021-12-21 10:50:22 +04:00
2022-05-03 15:52:37 +04:00
2022-06-28 11:06:02 +02:00
2019-08-16 13:31:52 +02:00
2022-03-14 15:16:16 +04:00
2022-08-01 11:58:02 +02:00
2017-07-27 14:23:09 +02:00
2016-02-04 17:01:04 +00:00
2019-02-05 16:50:18 +01:00
2021-01-23 15:55:07 -05:00
2022-04-27 10:49:28 -07:00
2022-04-27 07:50:28 +02:00