[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 01/25] main-loop.h: introduce qemu_in_main_thread()
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v4 01/25] main-loop.h: introduce qemu_in_main_thread() |
Date: |
Mon, 25 Oct 2021 13:33:13 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 |
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 <eesposit@redhat.com>
> Reviewed-by: Stefan Hajnoczi <stefanha@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é <philmd@redhat.com>
- [PATCH v4 00/25] block layer: split block APIs in global state and I/O, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 03/25] assertions for block global state API, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 01/25] main-loop.h: introduce qemu_in_main_thread(), Emanuele Giuseppe Esposito, 2021/10/25
- Re: [PATCH v4 01/25] main-loop.h: introduce qemu_in_main_thread(),
Philippe Mathieu-Daudé <=
- [PATCH v4 04/25] include/sysemu/block-backend: split header into I/O and global state (GS) API, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 02/25] include/block/block: split header into I/O and global state API, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 05/25] block/block-backend.c: assertions for block-backend, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 08/25] block: introduce assert_bdrv_graph_writable, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 07/25] assertions for block_int global state API, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 06/25] include/block/block_int: split header into I/O and global state API, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 12/25] assertions for blockob.h global state API, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 11/25] include/block/blockjob.h: global state API, Emanuele Giuseppe Esposito, 2021/10/25