yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
9ae3a8
From a7cfda7b304697450f0a55c22f4459b25999e9c5 Mon Sep 17 00:00:00 2001
9ae3a8
From: Max Reitz <mreitz@redhat.com>
9ae3a8
Date: Mon, 13 Mar 2017 17:47:05 +0100
9ae3a8
Subject: [PATCH 17/24] vhdx: Fix zero-fill iov length
9ae3a8
9ae3a8
RH-Author: Max Reitz <mreitz@redhat.com>
9ae3a8
Message-id: <20170313174706.29316-2-mreitz@redhat.com>
9ae3a8
Patchwork-id: 74279
9ae3a8
O-Subject: [RHEL-7.4 qemu-kvm PATCH 8/9] vhdx: Fix zero-fill iov length
9ae3a8
Bugzilla: 1427176
9ae3a8
RH-Acked-by: Fam Zheng <famz@redhat.com>
9ae3a8
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
9ae3a8
9ae3a8
From: Kevin Wolf <kwolf@redhat.com>
9ae3a8
9ae3a8
Fix the length of the zero-fill for the back, which was accidentally
9ae3a8
using the same value as for the front. This is caught by qemu-iotests
9ae3a8
033.
9ae3a8
9ae3a8
For consistency, change the code for the front as well to use the length
9ae3a8
stored in the iov (it is the same value, copied four lines above).
9ae3a8
9ae3a8
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
9ae3a8
Acked-by: Jeff Cody <jcody@redhat.com>
9ae3a8
(cherry picked from commit d1a126c53ddc563b7b731cee013e0362f7a5f22f)
9ae3a8
Signed-off-by: Max Reitz <mreitz@redhat.com>
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 block/vhdx.c | 4 ++--
9ae3a8
 1 file changed, 2 insertions(+), 2 deletions(-)
9ae3a8
9ae3a8
diff --git a/block/vhdx.c b/block/vhdx.c
9ae3a8
index 21ad6ad..47a872d 100644
9ae3a8
--- a/block/vhdx.c
9ae3a8
+++ b/block/vhdx.c
9ae3a8
@@ -1247,7 +1247,7 @@ static coroutine_fn int vhdx_co_writev(BlockDriverState *bs, int64_t sector_num,
9ae3a8
                         iov1.iov_base = qemu_blockalign(bs, iov1.iov_len);
9ae3a8
                         memset(iov1.iov_base, 0, iov1.iov_len);
9ae3a8
                         qemu_iovec_concat_iov(&hd_qiov, &iov1, 1, 0,
9ae3a8
-                                              sinfo.block_offset);
9ae3a8
+                                              iov1.iov_len);
9ae3a8
                         sectors_to_write += iov1.iov_len >> BDRV_SECTOR_BITS;
9ae3a8
                     }
9ae3a8
 
9ae3a8
@@ -1263,7 +1263,7 @@ static coroutine_fn int vhdx_co_writev(BlockDriverState *bs, int64_t sector_num,
9ae3a8
                         iov2.iov_base = qemu_blockalign(bs, iov2.iov_len);
9ae3a8
                         memset(iov2.iov_base, 0, iov2.iov_len);
9ae3a8
                         qemu_iovec_concat_iov(&hd_qiov, &iov2, 1, 0,
9ae3a8
-                                              sinfo.block_offset);
9ae3a8
+                                              iov2.iov_len);
9ae3a8
                         sectors_to_write += iov2.iov_len >> BDRV_SECTOR_BITS;
9ae3a8
                     }
9ae3a8
                 }
9ae3a8
-- 
9ae3a8
1.8.3.1
9ae3a8