vmdk: Fix big flat extent IO

Local variable "n" as int64_t avoids overflow with large sector number
calculation. See test case change for failure case.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Fam Zheng 2014-01-08 09:42:07 +08:00 committed by Kevin Wolf
parent 7fa9e1f941
commit 585ea0c841
3 changed files with 83 additions and 2 deletions

View file

@ -102,6 +102,13 @@ echo "=== Testing version 3 ==="
_use_sample_img iotest-version3.vmdk.bz2
_img_info
echo
echo "=== Testing 4TB monolithicFlat creation and IO ==="
IMGOPTS="subformat=monolithicFlat" _make_test_img 4T
_img_info
$QEMU_IO -c "write -P 0xa 900G 512" "$TEST_IMG" | _filter_qemu_io
$QEMU_IO -c "read -v 900G 1024" "$TEST_IMG" | _filter_qemu_io
# success, all done
echo "*** done"
rm -f $seq.full