diff options
author | Kevin Wolf <kwolf@redhat.com> | 2015-04-14 16:36:16 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2015-04-28 15:36:09 +0200 |
commit | d1a126c53ddc563b7b731cee013e0362f7a5f22f (patch) | |
tree | 708cf6013830ae7aafb5971bcf2dff988f90e182 /block/vhdx.c | |
parent | 8eedfbd4a50299f03b3630659c34ad1b01f69370 (diff) | |
download | qemu-d1a126c53ddc563b7b731cee013e0362f7a5f22f.zip qemu-d1a126c53ddc563b7b731cee013e0362f7a5f22f.tar.gz qemu-d1a126c53ddc563b7b731cee013e0362f7a5f22f.tar.bz2 |
vhdx: Fix zero-fill iov length
Fix the length of the zero-fill for the back, which was accidentally
using the same value as for the front. This is caught by qemu-iotests
033.
For consistency, change the code for the front as well to use the length
stored in the iov (it is the same value, copied four lines above).
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Acked-by: Jeff Cody <jcody@redhat.com>
Diffstat (limited to 'block/vhdx.c')
-rw-r--r-- | block/vhdx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/vhdx.c b/block/vhdx.c index bb3ed45..e24062f 100644 --- a/block/vhdx.c +++ b/block/vhdx.c @@ -1269,7 +1269,7 @@ static coroutine_fn int vhdx_co_writev(BlockDriverState *bs, int64_t sector_num, iov1.iov_base = qemu_blockalign(bs, iov1.iov_len); memset(iov1.iov_base, 0, iov1.iov_len); qemu_iovec_concat_iov(&hd_qiov, &iov1, 1, 0, - sinfo.block_offset); + iov1.iov_len); sectors_to_write += iov1.iov_len >> BDRV_SECTOR_BITS; } @@ -1285,7 +1285,7 @@ static coroutine_fn int vhdx_co_writev(BlockDriverState *bs, int64_t sector_num, iov2.iov_base = qemu_blockalign(bs, iov2.iov_len); memset(iov2.iov_base, 0, iov2.iov_len); qemu_iovec_concat_iov(&hd_qiov, &iov2, 1, 0, - sinfo.block_offset); + iov2.iov_len); sectors_to_write += iov2.iov_len >> BDRV_SECTOR_BITS; } } |