qemu-devel
[Top][All Lists]
Advanced

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

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


From: Paolo Bonzini
Subject: Re: [RFC PATCH-for-7.0 v2] cocoa: run qemu_init in the main thread
Date: Wed, 16 Mar 2022 18:31:13 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

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 thread. main() implemented in softmmu/main.c would call qemu_init(). If a function pointer gets registered in qemu_init(), it would create a thread for main loop and call the registered function pointer. Otherwise, it would directly call qemu_main_loop().

It would be a semantically appropriate division of ui/cocoa.m and softmmu/main.c. It would also be beneficial for end-users as it would also allow to isolate ui/cocoa.m into a separate module when --enable-modules in the future. (With "In the future", I mean sometime when we have time to hack Meson build files and some details we cannot fill by 7.0.)

I would like this for 7.1.

Basically rename qemu_main_loop to qemu_default_main_loop, and cocoa_display_init would do

    qemu_main_loop = qemu_cocoa_main_loop;

qemu_cocoa_main_loop would include the bulk of the current main of ui/cocoa.m. Seems like a good idea.

Paolo



reply via email to

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