[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH-for-7.0 v4 0/2] cocoa: run qemu_init in the main thread
From: |
Akihiko Odaki |
Subject: |
Re: [RFC PATCH-for-7.0 v4 0/2] cocoa: run qemu_init in the main thread |
Date: |
Mon, 21 Mar 2022 18:33:35 +0900 |
User-agent: |
Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 |
On 2022/03/21 18:14, Paolo Bonzini wrote:
On 3/19/22 14:56, Philippe Mathieu-Daudé wrote:
1. Move setgid and setuid calls after [+NSApplication
sharedApplication] to let NSApplication initialize as the original
user.
Another possibility is to move the code up to "[QemuApplication
sharedApplication]" from main() to cocoa_display_init().
Paolo
I'm for moving everything except [NSApp run] to cocoa_display_init().
This series moved Cocoa display initialization code to
[-QemuCocoaApplicatinController applicationDidFinishLaunching:] to keep
the initialization order for Cocoa, but it is unlikely that doing
initialization things before [-QemuCocoaApplicatinController
applicationDidFinishLaunching:] would cause problems. (The only Apple
thing affected by the change would be dispatch_sync, which is rarely
used.) The code movement is rather intrusive for QEMU as found with this
"runas" problem.
Doing Cocoa initialization things in [-QemuCocoaApplicatinController
applicationDidFinishLaunching:] and after the method call can be even
dangerous as it would modify the state of Cocoa, which is already
running. "Create menus in iothread" patch series actually triggered such
a problem and required careful coding:
20220321041043.24112-1-akihiko.odaki@gmail.com/">https://patchew.org/QEMU/20220321041043.24112-1-akihiko.odaki@gmail.com/
The code movement also requires more code to keep the content of
DisplayOptions and to have the definition of
[-QemuCocoaApplicatinController applicationDidFinishLaunching:]. It
would be simply nice if we could remove them.
Regards,
Akihiko Odaki