qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC uncompiled PATCH] cocoa: run qemu_init in the main thread


From: Philippe Mathieu-Daudé
Subject: Re: [RFC uncompiled PATCH] cocoa: run qemu_init in the main thread
Date: Wed, 16 Mar 2022 17:02:32 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

On 7/3/22 16: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.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
  softmmu/main.c |  12 +++--
  ui/cocoa.m     | 122 +++++++++++++++++++------------------------------
  2 files changed, 53 insertions(+), 81 deletions(-)

I got this building and it indeed fixes the issue reported here:
cecef6bd-951a-aab6-e603-96e3551e3e9e@gmail.com/">https://lore.kernel.org/qemu-devel/cecef6bd-951a-aab6-e603-96e3551e3e9e@gmail.com/

I will post as v2 and let you iterate :)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]