[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 02/25] include/block/block: split header into I/O and glob
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v4 02/25] include/block/block: split header into I/O and global state API |
Date: |
Mon, 25 Oct 2021 13:37:24 +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:
> block.h currently contains a mix of functions:
> some of them run under the BQL and modify the block layer graph,
> others are instead thread-safe and perform I/O in iothreads.
> It is not easy to understand which function is part of which
> group (I/O vs GS), and this patch aims to clarify it.
>
> The "GS" functions need the BQL, and often use
> aio_context_acquire/release and/or drain to be sure they
> can modify the graph safely.
> The I/O function are instead thread safe, and can run in
> any AioContext.
>
> By splitting the header in two files, block-io.h
> and block-global-state.h we have a clearer view on what
> needs what kind of protection. block-common.h
> contains common structures shared by both headers.
>
> block.h is left there for legacy and to avoid changing
> all includes in all c files that use the block APIs.
>
> Assertions are added in the next patch.
>
> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> block.c | 3 +
> block/meson.build | 7 +-
> include/block/block-common.h | 389 +++++++++++++
Can this patch be split in 3?
(first)
> include/block/block-global-state.h | 286 ++++++++++
(second)
> include/block/block-io.h | 306 ++++++++++
(third)
> include/block/block.h | 878 +----------------------------
> 6 files changed, 1012 insertions(+), 857 deletions(-)
> create mode 100644 include/block/block-common.h
> create mode 100644 include/block/block-global-state.h
> create mode 100644 include/block/block-io.h
Also consider enabling scripts/git.orderfile to ease patch review.
- [PATCH v4 00/25] block layer: split block APIs in global state and I/O, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 01/25] main-loop.h: introduce qemu_in_main_thread(), Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 03/25] assertions for block global state 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
- Re: [PATCH v4 02/25] include/block/block: split header into I/O and global state API,
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 05/25] block/block-backend.c: assertions for block-backend, 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 08/25] block: introduce assert_bdrv_graph_writable, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 09/25] include/block/blockjob_int.h: split header into I/O and GS API, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 11/25] include/block/blockjob.h: 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 10/25] assertions for blockjob_int.h, Emanuele Giuseppe Esposito, 2021/10/25