aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/063
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2018-06-29 14:03:26 +0800
committerKevin Wolf <kwolf@redhat.com>2018-06-29 14:20:56 +0200
commite06f4639d8a93703eecc3aad06c8a3e9b2ef4968 (patch)
tree08b06d2bb4ec3f9603d71130c1d3ec1f62da75e4 /tests/qemu-iotests/063
parent33d70fb6faa3b8b2aac47a2052a4943c94fc48a2 (diff)
qcow2: Fix src_offset in copy offloading
Not updating src_offset will result in wrong data being written to dst image. Reported-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/063')
-rwxr-xr-xtests/qemu-iotests/0639
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/qemu-iotests/063 b/tests/qemu-iotests/063
index e4f6ea9385..adc037c1f5 100755
--- a/tests/qemu-iotests/063
+++ b/tests/qemu-iotests/063
@@ -91,6 +91,15 @@ if $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n "$TEST_IMG.orig" "$TEST_IMG" >/dev
exit 1
fi
+echo "== Regression testing for copy offloading bug =="
+
+_make_test_img 1M
+TEST_IMG="$TEST_IMG.target" _make_test_img 1M
+$QEMU_IO -c 'write -P 1 0 512k' -c 'write -P 2 512k 512k' "$TEST_IMG" | _filter_qemu_io
+$QEMU_IO -c 'write -P 4 512k 512k' -c 'write -P 3 0 512k' "$TEST_IMG.target" | _filter_qemu_io
+$QEMU_IMG convert -n -O $IMGFMT "$TEST_IMG" "$TEST_IMG.target"
+$QEMU_IMG compare "$TEST_IMG" "$TEST_IMG.target"
+
echo "*** done"
rm -f $seq.full
status=0