Re: [RFC PATCH-for-7.0 v2] cocoa: run qemu_init in the main thread

2022-03-17 Thread Philippe Mathieu-Daudé
On 17/3/22 12:57, Paolo Bonzini wrote: Just one change to aid future reading of the code, possibly.  Move this line: On 3/16/22 17:03, Philippe Mathieu-Daudé wrote: +    qemu_event_init(&cbevent, false); just before +    cbowner = [[QemuCocoaPasteboardTypeOwner alloc] init]; i.e. the place

Re: [RFC PATCH-for-7.0 v2] cocoa: run qemu_init in the main thread

2022-03-17 Thread Paolo Bonzini
Just one change to aid future reading of the code, possibly. Move this line: On 3/16/22 17:03, Philippe Mathieu-Daudé wrote: +qemu_event_init(&cbevent, false); just before +cbowner = [[QemuCocoaPasteboardTypeOwner alloc] init]; i.e. the place where it was before the patch, in cocoa

Re: [RFC PATCH-for-7.0 v2] cocoa: run qemu_init in the main thread

2022-03-17 Thread Paolo Bonzini
On 3/16/22 22:06, Peter Maydell wrote: Speaking of 7.1, is cocoa currently completely broken, ie in need of an interim fix for 7.0 ? If so, which of the various patches/approaches should it be ? To answer the first half of my question, yes, the cocoa UI is currently completely broken as it asse

Re: [RFC PATCH-for-7.0 v2] cocoa: run qemu_init in the main thread

2022-03-16 Thread Peter Maydell
On Wed, 16 Mar 2022 at 19:29, Peter Maydell wrote: > > On Wed, 16 Mar 2022 at 17:31, Paolo Bonzini wrote: > > > > On 3/16/22 17:22, Akihiko Odaki wrote: > > > I was thinking that it may be better to let softmmu/main.c do the > > > details if it involves the internals of qemu_main() like qemu_main

Re: [RFC PATCH-for-7.0 v2] cocoa: run qemu_init in the main thread

2022-03-16 Thread Peter Maydell
On Wed, 16 Mar 2022 at 17:31, Paolo Bonzini wrote: > > On 3/16/22 17:22, Akihiko Odaki wrote: > > I was thinking that it may be better to let softmmu/main.c do the > > details if it involves the internals of qemu_main() like qemu_main_loop(). > > > > More concretely, softmmu/main.c would provide a

Re: [RFC PATCH-for-7.0 v2] cocoa: run qemu_init in the main thread

2022-03-16 Thread Paolo Bonzini
On 3/16/22 17:22, Akihiko Odaki wrote: I was thinking that it may be better to let softmmu/main.c do the details if it involves the internals of qemu_main() like qemu_main_loop(). More concretely, softmmu/main.c would provide a function to register a function pointer to take over the main thre

Re: [RFC PATCH-for-7.0 v2] cocoa: run qemu_init in the main thread

2022-03-16 Thread Akihiko Odaki
On 2022/03/17 1:03, Philippe Mathieu-Daudé wrote: From: Paolo Bonzini 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 itse

Re: [RFC PATCH-for-7.0 v2] cocoa: run qemu_init in the main thread

2022-03-16 Thread Akihiko Odaki
On 2022/03/17 1:03, Philippe Mathieu-Daudé wrote: From: Paolo Bonzini 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 itse