On Thu, 2022-02-03 at 14:19 +0000, Stefan Hajnoczi wrote: > Yep, I didn't comment on this because I don't have a good suggestion. > > In terms of semantics I think we should have: > > 1. A global default value that all new AioContext take. The QEMU main > loop's qemu_aio_context will use this and all IOThread AioContext > will use it (unless they have been overridden). > > I would define it on --machine because that's the "global" object for > a guest, but that's not very satisfying.
So I tried to implement this. One problem arouse: - The thread pool properties are now part of the MachineState. So as to properly use QOM. - Sadly, the main loop is initialized before the machine class options are populated. See 'qemu_init_main_loop()' and 'qemu_apply_machine_options()' in 'softmmu/vl.c'. - Short of manually parsing the options, which IMO defeats the purpose of using QOM, or changing the initialization order, which I'm sure won't be easy, I can't access the properties early enough. Any ideas? Thanks! -- Nicolás Sáenz