On 10/25/21 12:17, Emanuele Giuseppe Esposito wrote: > When invoked from the main loop, this function is the same > as qemu_mutex_iothread_locked, and returns true if the BQL is held. > When invoked from iothreads or tests, it returns true only > if the current AioContext is the Main Loop. > > This essentially just extends qemu_mutex_iothread_locked to work > also in unit tests or other users like storage-daemon, that run > in the Main Loop but end up using the implementation in > stubs/iothread-lock.c. > > Using qemu_mutex_iothread_locked in unit tests defaults to false > because they use the implementation in stubs/iothread-lock, > making all assertions added in next patches fail despite the
"in the following commits"? > AioContext is still the main loop. > > Signed-off-by: Emanuele Giuseppe Esposito <eespo...@redhat.com> > Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> > --- > include/qemu/main-loop.h | 13 +++++++++++++ > softmmu/cpus.c | 5 +++++ > stubs/iothread-lock.c | 5 +++++ > 3 files changed, 23 insertions(+) Reviewed-by: Philippe Mathieu-Daudé <phi...@redhat.com>