All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] ui/cocoa: Run qemu_init in the main thread
@ 2022-07-15 11:40 Akihiko Odaki
  2022-07-15 11:40 ` [PATCH v2 1/3] " Akihiko Odaki
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Akihiko Odaki @ 2022-07-15 11:40 UTC (permalink / raw)
  Cc: qemu-devel, Peter Maydell, Paolo Bonzini, Gerd Hoffmann,
	Emanuele Giuseppe Esposito, Kevin Wolf,
	Philippe Mathieu-Daudé,
	Akihiko Odaki

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.

v2: Restore allow_events flag to fix the crash reported by
    Philippe Mathieu-Daudé.

Akihiko Odaki (3):
  ui/cocoa: Run qemu_init in the main thread
  Revert "main-loop: Disable block backend global state assertion on
    Cocoa"
  meson: Allow to enable gtk and sdl while cocoa is enabled

 docs/devel/fuzzing.rst   |   4 +-
 include/qemu-main.h      |   3 +-
 include/qemu/main-loop.h |  13 ---
 include/sysemu/sysemu.h  |   2 +-
 meson.build              |  10 +--
 softmmu/main.c           |  14 ++--
 softmmu/vl.c             |   2 +-
 tests/qtest/fuzz/fuzz.c  |   2 +-
 ui/cocoa.m               | 167 +++++++++++++--------------------------
 9 files changed, 72 insertions(+), 145 deletions(-)

-- 
2.32.1 (Apple Git-133)



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-07-15 13:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-15 11:40 [PATCH v2 0/3] ui/cocoa: Run qemu_init in the main thread Akihiko Odaki
2022-07-15 11:40 ` [PATCH v2 1/3] " Akihiko Odaki
2022-07-15 13:10   ` Peter Maydell
2022-07-15 13:19     ` Akihiko Odaki
2022-07-15 13:26       ` Peter Maydell
2022-07-15 11:40 ` [PATCH v2 2/3] Revert "main-loop: Disable block backend global state assertion on Cocoa" Akihiko Odaki
2022-07-15 12:58   ` Peter Maydell
2022-07-15 11:40 ` [PATCH v2 3/3] meson: Allow to enable gtk and sdl while cocoa is enabled Akihiko Odaki
2022-07-15 12:58   ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.