summaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/103
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2015-06-01 18:09:18 +0200
committerKevin Wolf <kwolf@redhat.com>2015-06-12 15:54:01 +0200
commita4291eafc597c0944057930acf3e51d899f79c2e (patch)
tree17002b458b71ed6d30cd00baff633ee536cbfc4c /tests/qemu-iotests/103
parent57e216695948a79d9ced82fc217a37cce70fd986 (diff)
downloadqemu-a4291eafc597c0944057930acf3e51d899f79c2e.tar.gz
iotests: qcow2 COW with minimal L2 cache size
This adds a test case to test 103 for performing a COW operation in a qcow2 image using an L2 cache with minimal size (which should be at least two clusters so the COW can access both source and destination simultaneously). Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/103')
-rwxr-xr-xtests/qemu-iotests/10310
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/qemu-iotests/103 b/tests/qemu-iotests/103
index ccab551f63..fa9a3c1fc9 100755
--- a/tests/qemu-iotests/103
+++ b/tests/qemu-iotests/103
@@ -93,6 +93,16 @@ $QEMU_IO -c "open -o l2-cache-size=1M,refcount-cache-size=0.25M $TEST_IMG" \
-c 'read -P 42 0 64k' \
| _filter_qemu_io
+echo
+echo '=== Testing minimal L2 cache and COW ==='
+echo
+
+$QEMU_IMG snapshot -c foo "$TEST_IMG"
+# This requires a COW operation, which accesses two L2 tables simultaneously
+# (COW source and destination), so there must be enough space in the cache to
+# place both tables there (and qemu should not crash)
+$QEMU_IO -c "open -o cache-size=0 $TEST_IMG" -c 'write 0 64k' | _filter_qemu_io
+
# success, all done
echo '*** done'
rm -f $seq.full