On Thu, May 08, 2014 at 03:10:48PM +0200, Paolo Bonzini wrote: > Il 08/05/2014 15:08, Kevin Wolf ha scritto: > >Am 08.05.2014 um 12:16 hat Stefan Hajnoczi geschrieben: > >>Side note: The main loop and IOThread are both event loops but their code is > >>not shared completely. Sometimes it is useful to remember that although > >>they > >>are conceptually similar they are currently not interchangeable. > > > >We need to be careful with the terminology. The choice made here, that > >the main loop thread is not an IOThread, is somewhat unfortunate, > >because traditionally, the "I/O thread" has been what the main loop > >thread is called (in contrast to vcpu threads). > > Note that the main loop thread could definitely be an IOThread, > since it has an AioContext and the IOThread is just a QOM veneer for > AioContext. It's just not done yet.
Yes, it's definitely a goal to unify the event loop implementations in QEMU. The main loop is more than just an AioContext, it's a glib event loop. The AioContext is a custom event loop that can be added to a glib event loop (as a GSource) but also supports BHs and high-resolution timers. Stefan