From: Peter Maydell <peter.maydell@linaro.org>
To: Akihiko Odaki <akihiko.odaki@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [RFC uncompiled PATCH] cocoa: run qemu_init in the main thread
Date: Mon, 7 Mar 2022 16:14:04 +0000 [thread overview]
Message-ID: <CAFEAcA8XshU90eKJM_4+_mLRhUCN+ExWzCkPTveLht0bWBb8=w@mail.gmail.com> (raw)
In-Reply-To: <59f773ed-9a1f-10ff-637e-b41848aa534d@gmail.com>
On Mon, 7 Mar 2022 at 15:34, Akihiko Odaki <akihiko.odaki@gmail.com> wrote:
>
> On 2022/03/08 0:10, Paolo Bonzini wrote:
> > Simplify the initialization dance by running qemu_init() in the main
> > thread before the Cocoa event loop starts. The cocoa_display_init()
> > code that is post-applicationDidFinishLaunching: moves to the
> > application delegate itself, and the secondary thread only runs
> > the rest of qemu_main(), namely 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. The newly-introduced assertions in the block layer
> > complain about this.
>
> Hi,
>
> Thanks for this interesting suggestion. However I don't think this
> improves the situation much. The main contribution of this change is
> that elimination of display_init_sem but it is still necessary for
> command line usage of the executable.
The main benefit of Paolo's suggestion from my point of view is
that it entirely eliminates the odd situation where cocoa.m wants to
make calls back into QEMU code where it does not itself hold
the iothread lock in the current thread, but instead knows that
some other thread does and is waiting for it. Instead we end up
with a much more straightforward situation of "every time we
call into QEMU code we hold the iothread lock directly ourselves".
thanks
-- PMM
next prev parent reply other threads:[~2022-03-07 16:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-07 15:10 [RFC uncompiled PATCH] cocoa: run qemu_init in the main thread Paolo Bonzini
2022-03-07 15:34 ` Akihiko Odaki
2022-03-07 16:14 ` Peter Maydell [this message]
2022-03-07 16:27 ` Akihiko Odaki
2022-03-07 16:35 ` Peter Maydell
2022-03-07 16:41 ` Akihiko Odaki
2022-03-07 17:21 ` Paolo Bonzini
2022-03-07 19:25 ` Akihiko Odaki
2022-03-07 16:39 ` Paolo Bonzini
2022-03-07 17:03 ` Akihiko Odaki
2022-03-07 17:06 ` Paolo Bonzini
2022-03-16 16:02 ` Philippe Mathieu-Daudé
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='CAFEAcA8XshU90eKJM_4+_mLRhUCN+ExWzCkPTveLht0bWBb8=w@mail.gmail.com' \
--to=peter.maydell@linaro.org \
--cc=akihiko.odaki@gmail.com \
--cc=pbonzini@redhat.com \
--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).