[Qemu-devel] [PATCH v3 0/7] ui/cocoa: Use OSX's main loop

Peter Maydell posted 7 patches 5 years, 2 months ago
Test asan passed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu failed
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190225102433.22401-1-peter.maydell@linaro.org
Maintainers: Gerd Hoffmann <kraxel@redhat.com>, Peter Maydell <peter.maydell@linaro.org>
ui/cocoa.m | 495 ++++++++++++++++++++++++++++++++---------------------
1 file changed, 303 insertions(+), 192 deletions(-)
[Qemu-devel] [PATCH v3 0/7] ui/cocoa: Use OSX's main loop
Posted by Peter Maydell 5 years, 2 months ago
This set of patches rearranges how we handle events on
the OSX Cocoa UI so that we use the main thread to run
the OSX event loop, and we don't do a long blocking
operation from the applicationDidFinishLaunching callback.
Instead we create a second thread which runs qemu_main()
and becomes the QEMU main-loop thread. The callbacks from
QEMU into the cocoa code asynchronously dispatch their
work to the main thread, and the main thread takes the
iothread lock before calling into QEMU code.

The changes from v2 to v3 are all minor, and all patches
have now had review/test; I plan to apply this to master
towards the end of the week, absent any further review
comments.

 * patch 1: add with_iothread_lock wrap to qmp_stop/qmp_cont calls
 * patch 5: remove stray whitespace
 * patch 7: remove unnecessary null check on cocoaView
 * patch 7: make semaphore variables file-local
 * patch 7: deref pixman_image in dealloc

thanks
-- PMM

Peter Maydell (7):
  ui/cocoa: Ensure we have the iothread lock when calling into QEMU
  ui/cocoa: Use the pixman image directly in switchSurface
  ui/cocoa: Factor out initial menu creation
  ui/cocoa: Move console/device menu creation code up in file
  ui/cocoa: Don't call NSApp sendEvent directly from handleEvent
  ui/cocoa: Subclass NSApplication so we can implement sendEvent
  ui/cocoa: Perform UI operations only on the main thread

 ui/cocoa.m | 495 ++++++++++++++++++++++++++++++++---------------------
 1 file changed, 303 insertions(+), 192 deletions(-)

-- 
2.17.2 (Apple Git-113)


Re: [Qemu-devel] [PATCH v3 0/7] ui/cocoa: Use OSX's main loop
Posted by Peter Maydell 5 years, 2 months ago
...oops, looks like I got Roman's email address wrong (I
cut-n-pasted it from the one reviewed-by tag that happened
to typo it :-( ). Sorry about that.

-- PMM

On Mon, 25 Feb 2019 at 10:24, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> This set of patches rearranges how we handle events on
> the OSX Cocoa UI so that we use the main thread to run
> the OSX event loop, and we don't do a long blocking
> operation from the applicationDidFinishLaunching callback.
> Instead we create a second thread which runs qemu_main()
> and becomes the QEMU main-loop thread. The callbacks from
> QEMU into the cocoa code asynchronously dispatch their
> work to the main thread, and the main thread takes the
> iothread lock before calling into QEMU code.
>
> The changes from v2 to v3 are all minor, and all patches
> have now had review/test; I plan to apply this to master
> towards the end of the week, absent any further review
> comments.
>
>  * patch 1: add with_iothread_lock wrap to qmp_stop/qmp_cont calls
>  * patch 5: remove stray whitespace
>  * patch 7: remove unnecessary null check on cocoaView
>  * patch 7: make semaphore variables file-local
>  * patch 7: deref pixman_image in dealloc
>
> thanks
> -- PMM