From: Paolo Bonzini <pbonzini@redhat.com>
To: Akihiko Odaki <akihiko.odaki@gmail.com>
Cc: qemu-devel@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Emanuele Giuseppe Esposito" <eesposit@redhat.com>,
"Kevin Wolf" <kwolf@redhat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: Re: [PATCH v4 0/3] ui/cocoa: Run qemu_init in the main thread
Date: Mon, 18 Jul 2022 18:09:30 +0200 [thread overview]
Message-ID: <2a1c39eb-a9fe-c9c0-3f77-4b490e1197e9@redhat.com> (raw)
In-Reply-To: <20220717073340.25830-1-akihiko.odaki@gmail.com>
On 7/17/22 09:33, Akihiko Odaki wrote:
> 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.
>
> v4: Asynchronously call -[NSApplication terminate:] to avoid potential
> deadlock with qemu_thread_join(). (Paolo Bonzini)
>
> v3: Document functions involved in startup. (Peter Maydell)
>
> 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 | 168 ++++++++++++++-------------------------
> 9 files changed, 76 insertions(+), 142 deletions(-)
>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Thanks for continuing this work!
Paolo
prev parent reply other threads:[~2022-07-18 16:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-17 7:33 [PATCH v4 0/3] ui/cocoa: Run qemu_init in the main thread Akihiko Odaki
2022-07-17 7:33 ` [PATCH v4 1/3] " Akihiko Odaki
2022-07-17 7:33 ` [PATCH v4 2/3] Revert "main-loop: Disable block backend global state assertion on Cocoa" Akihiko Odaki
2022-07-17 7:33 ` [PATCH v4 3/3] meson: Allow to enable gtk and sdl while cocoa is enabled Akihiko Odaki
2022-07-18 16:09 ` Paolo Bonzini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2a1c39eb-a9fe-c9c0-3f77-4b490e1197e9@redhat.com \
--to=pbonzini@redhat.com \
--cc=akihiko.odaki@gmail.com \
--cc=eesposit@redhat.com \
--cc=f4bug@amsat.org \
--cc=kraxel@redhat.com \
--cc=kwolf@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).