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 > Reviewed-by: Eric Blake > --- > @@ -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