[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v2 01/25] main-loop.h: introduce qemu_in_main_thread()
From: |
Stefan Hajnoczi |
Subject: |
Re: [RFC PATCH v2 01/25] main-loop.h: introduce qemu_in_main_thread() |
Date: |
Thu, 7 Oct 2021 10:05:20 +0100 |
On Tue, Oct 05, 2021 at 10:31:51AM -0400, 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
> AioContext is still the main loop.
>
> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
> ---
> include/qemu/main-loop.h | 13 +++++++++++++
> softmmu/cpus.c | 5 +++++
> stubs/iothread-lock.c | 5 +++++
> 3 files changed, 23 insertions(+)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
signature.asc
Description: PGP signature