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 <[email protected]>
---
  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:
https://lore.kernel.org/qemu-devel/[email protected]/

I will post as v2 and let you iterate :)

Reply via email to