[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 1/4] iotests/109: Don't mirror with mismatched size
From: |
Max Reitz |
Subject: |
Re: [PATCH v2 1/4] iotests/109: Don't mirror with mismatched size |
Date: |
Mon, 11 May 2020 17:08:20 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
On 11.05.20 15:58, Kevin Wolf wrote:
> This patch makes the raw image the same size as the file in a different
> format that is mirrored as raw to it to avoid errors when mirror starts
> to enforce that source and target are the same size.
>
> We check only that the first 512 bytes are zeroed (instead of 64k)
> because some image formats create image files that are smaller than 64k,
> so trying to read 64k would result in I/O errors. Apart from this, 512
> is more appropriate anyway because the raw format driver protects
> specifically the first 512 bytes.
>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> tests/qemu-iotests/109 | 10 ++---
> tests/qemu-iotests/109.out | 74 +++++++++++++-------------------
> tests/qemu-iotests/common.filter | 5 +++
> 3 files changed, 41 insertions(+), 48 deletions(-)
>
> diff --git a/tests/qemu-iotests/109 b/tests/qemu-iotests/109
> index 5bc2e9b001..3ffeaf3c55 100755
> --- a/tests/qemu-iotests/109
> +++ b/tests/qemu-iotests/109
> @@ -77,14 +77,14 @@ for fmt in qcow qcow2 qed vdi vmdk vpc; do
> echo "=== Writing a $fmt header into raw ==="
> echo
>
> - _make_test_img 64M
> TEST_IMG="$TEST_IMG.src" IMGFMT=$fmt _make_test_img 64M
> + _make_test_img $(du -b "$TEST_IMG.src" | cut -f1) |
> _filter_img_create_size
Why du and not the file length (stat -c '%s')?
Max
signature.asc
Description: OpenPGP digital signature
[PATCH v2 4/4] iotests: Mirror with different source/target size, Kevin Wolf, 2020/05/11