[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 02/17] block: Introduce bdrv_driver_pwritev()
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v2 02/17] block: Introduce bdrv_driver_pwritev() |
Date: |
Sat, 30 Apr 2016 15:54:00 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 04/28/2016 07:16 AM, Kevin Wolf wrote:
> This is a function that simply calls into the block driver for doing a
> write, providing the byte granularity interface we want to eventually
> have everywhere, and using whatever interface that driver supports.
>
> This one is a bit more interesting that the version for reads: It adds
> support for .bdrv_co_writev_flags() everywhere, so that drivers
> implementing this function can drop .bdrv_co_writev() now.
>
> Signed-off-by: Kevin Wolf <address@hidden>
> Reviewed-by: Eric Blake <address@hidden>
> ---
> @@ -1155,7 +1186,8 @@ static int coroutine_fn
> bdrv_co_do_write_zeroes(BlockDriverState *bs,
> }
> qemu_iovec_init_external(&qiov, &iov, 1);
>
> - ret = drv->bdrv_co_writev(bs, sector_num, num, &qiov);
> + ret = bdrv_driver_pwritev(bs, sector_num * BDRV_SECTOR_SIZE,
> + num * BDRV_SECTOR_SIZE, &qiov, 0);
My review missed a latent bug here (pre-patch this should have been
using bdrv_co_writev_flags(..., flags & ~BDRV_REQ_ZERO_WRITE) so as to
keep BDRV_REQ_FUA semantics working), so as penance I've sent a patch.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v2 00/17] block: Convert .bdrv_read/write to .bdrv_preadv/pwritev, Kevin Wolf, 2016/04/28
- [Qemu-devel] [PATCH v2 02/17] block: Introduce bdrv_driver_pwritev(), Kevin Wolf, 2016/04/28
- [Qemu-devel] [PATCH v2 01/17] block: Introduce bdrv_driver_preadv(), Kevin Wolf, 2016/04/28
- [Qemu-devel] [PATCH v2 04/17] block: Rename bdrv_co_do_preadv/writev to bdrv_co_preadv/writev, Kevin Wolf, 2016/04/28
- [Qemu-devel] [PATCH v2 03/17] block: Support AIO drivers in bdrv_driver_preadv/pwritev(), Kevin Wolf, 2016/04/28
- [Qemu-devel] [PATCH v2 09/17] vdi: Implement .bdrv_co_preadv() interface, Kevin Wolf, 2016/04/28
- [Qemu-devel] [PATCH v2 08/17] dmg: Implement .bdrv_co_preadv() interface, Kevin Wolf, 2016/04/28
- [Qemu-devel] [PATCH v2 06/17] bochs: Implement .bdrv_co_preadv() interface, Kevin Wolf, 2016/04/28