[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
- [RFC PATCH v2 00/25] block layer: split block APIs in global state and I/O, Emanuele Giuseppe Esposito, 2021/10/05
- [RFC PATCH v2 02/25] include/sysemu/block-backend: split header into I/O and global state (GS) API, Emanuele Giuseppe Esposito, 2021/10/05
- [RFC PATCH v2 01/25] main-loop.h: introduce qemu_in_main_thread(), Emanuele Giuseppe Esposito, 2021/10/05
- Re: [RFC PATCH v2 01/25] main-loop.h: introduce qemu_in_main_thread(),
Stefan Hajnoczi <=
- [RFC PATCH v2 03/25] block/block-backend.c: assertions for block-backend, Emanuele Giuseppe Esposito, 2021/10/05
- [RFC PATCH v2 05/25] assertions for block global state API, Emanuele Giuseppe Esposito, 2021/10/05
- [RFC PATCH v2 06/25] include/block/block_int: split header into I/O and global state API, Emanuele Giuseppe Esposito, 2021/10/05