aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/033
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2016-04-13 12:47:08 +0200
committerKevin Wolf <kwolf@redhat.com>2016-04-15 17:22:11 +0200
commit7fa84cd8d4b5ce3939bc2498010f6640e855dbad (patch)
tree4619b5ab9a523c68a800576d5e996ced47b0b94f /tests/qemu-iotests/033
parent5ceb77652e3bf03bbe4cbc580db8bd1ce7a3cd1f (diff)
block: Fix blk_aio_write_zeroes()
Commit 57d6a428 broke blk_aio_write_zeroes() because in some write functions in the call path don't have an explicit length argument but reuse qiov->size instead. Which is great, except that write_zeroes doesn't have a qiov, which this commit interprets as 0 bytes. Consequently, blk_aio_write_zeroes() didn't effectively do anything. This patch introduces an explicit acb->bytes in BlkAioEmAIOCB and uses that instead of acb->rwco.size. The synchronous version of the function is okay because it does pass a qiov (with the right size and a NULL pointer as its base). Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/033')
-rwxr-xr-xtests/qemu-iotests/0338
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/qemu-iotests/033 b/tests/qemu-iotests/033
index a61d8ced1c..912373d23b 100755
--- a/tests/qemu-iotests/033
+++ b/tests/qemu-iotests/033
@@ -57,12 +57,13 @@ do_test()
} | $QEMU_IO
}
+for write_zero_cmd in "write -z" "aio_write -z"; do
for align in 512 4k; do
echo
echo "== preparing image =="
do_test $align "write -P 0xa 0x200 0x400" "$TEST_IMG" | _filter_qemu_io
do_test $align "write -P 0xa 0x20000 0x600" "$TEST_IMG" | _filter_qemu_io
- do_test $align "write -z 0x400 0x20000" "$TEST_IMG" | _filter_qemu_io
+ do_test $align "$write_zero_cmd 0x400 0x20000" "$TEST_IMG" | _filter_qemu_io
echo
echo "== verifying patterns (1) =="
@@ -73,7 +74,7 @@ for align in 512 4k; do
echo
echo "== rewriting zeroes =="
do_test $align "write -P 0xb 0x10000 0x10000" "$TEST_IMG" | _filter_qemu_io
- do_test $align "write -z 0x10000 0x10000" "$TEST_IMG" | _filter_qemu_io
+ do_test $align "$write_zero_cmd 0x10000 0x10000" "$TEST_IMG" | _filter_qemu_io
echo
echo "== verifying patterns (2) =="
@@ -82,7 +83,7 @@ for align in 512 4k; do
echo
echo "== rewriting unaligned zeroes =="
do_test $align "write -P 0xb 0x0 0x1000" "$TEST_IMG" | _filter_qemu_io
- do_test $align "write -z 0x200 0x200" "$TEST_IMG" | _filter_qemu_io
+ do_test $align "$write_zero_cmd 0x200 0x200" "$TEST_IMG" | _filter_qemu_io
echo
echo "== verifying patterns (3) =="
@@ -92,6 +93,7 @@ for align in 512 4k; do
echo
done
+done
# success, all done
echo "*** done"