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 > --- > 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