[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/6] block-backend: Refactor AIO emulation
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 3/6] block-backend: Refactor AIO emulation |
Date: |
Fri, 15 Jun 2018 16:21:56 +0100 |
User-agent: |
Mutt/1.10.0 (2018-05-17) |
On Fri, Jun 08, 2018 at 02:04:14PM +0800, Fam Zheng wrote:
> BlkRwCo fields are multi-purposed. @offset is sometimes used to pass the
> 'req' number for blk_ioctl and blk_aio_ioctl; @iobuf is sometimes the
> pointer for QEMUIOVector @qiov sometimes the ioctl @buf. This is not as
> clean as it can be. As the coming copy range emulation wants to add
> more differentiation in parameters, refactor a bit.
>
> Move the per-request fields to a union and create one struct for each
> type. While at it also move the bytes parameter from BlkAioEmAIOCB to
> BlkRwCo.
>
> Signed-off-by: Fam Zheng <address@hidden>
> ---
> block/block-backend.c | 211 +++++++++++++++++++++++++++---------------
> 1 file changed, 134 insertions(+), 77 deletions(-)
I'm not sure about this patch. It makes the code longer and adds more
types but still includes hacky cases for pdiscard and flush that only
partially use the union.
IMO either make the code really clean with proper types or stick with
the short but unsafe form.
signature.asc
Description: PGP signature
- [Qemu-devel] [PATCH 0/6] mirror: Use copy offloading, Fam Zheng, 2018/06/08
- [Qemu-devel] [PATCH 1/6] file-posix: Fix EINTR handling, Fam Zheng, 2018/06/08
- [Qemu-devel] [PATCH 2/6] block: Check if block drivers can do copy offloading, Fam Zheng, 2018/06/08
- [Qemu-devel] [PATCH 4/6] block-backend: Add blk_aio_copy_range, Fam Zheng, 2018/06/08
- [Qemu-devel] [PATCH 3/6] block-backend: Refactor AIO emulation, Fam Zheng, 2018/06/08
- Re: [Qemu-devel] [PATCH 3/6] block-backend: Refactor AIO emulation,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH 5/6] block: Add backing passthrough implementations for copy_range, Fam Zheng, 2018/06/08
- [Qemu-devel] [PATCH 6/6] mirror: Use copy offloading, Fam Zheng, 2018/06/08