Skip to contentSkip to conversation

iotests/197: Fix for compat=0.10

PATCH In review Max Reitz 2 participants 2 messages Jul 27, 2020

lore
Share & tools
lore

Max Reitz

author
#0 lore raw

PATCH 1/1 iotests/197: Fix for compat=0.10

Writing zeroes to a qcow2 v2 images without a backing file results in an unallocated cluster as of 61b3043965. 197 has a test for COR-ing a cluster on an image without a backing file, which means that the data will be zero, so now on a v2 image that cluster will just stay unallocated, and so the test fails. Just force compat=1.1 for that particular case to enforce the cluster to get allocated.

Fixes 61b3043965fe3552ee2684a97e7cc809ca7a71b3
---
 tests/qemu-iotests/197 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tests/qemu-iotests/197 +3 -1
index 95f05b0e34..121959a09c 100755
@@ -112,7 +112,9 @@ echo
 echo '=== Partial final cluster ==='
 echo
 
-_make_test_img 1024
+# Force compat=1.1, because writing zeroes on a v2 image without a
+# backing file would just result in an unallocated cluster
+_make_test_img -o compat=1.1 1024
 $QEMU_IO -f $IMGFMT -C -c 'read 0 1024' "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -f $IMGFMT -c map "$TEST_IMG"
 _check_test_img
Signature · 1 line
2.26.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Max Reitz

Writing zeroes to a qcow2 v2 images without a backing file results in an unallocated cluster as of 61b3043965. 197 has a test for COR-ing a cluster on an image without a backing file, which means that the data will be zero, so now on a v2 image that cluster will just stay unallocated, and so the test fails. Just force compat=1.1 for that particular case to enforce the cluster to get allocated.

Quoted 5 lines
Fixes 61b3043965fe3552ee2684a97e7cc809ca7a71b3
---
  tests/qemu-iotests/197 | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
Quoted 17 lines
tests/qemu-iotests/197 +3 -1
index 95f05b0e34..121959a09c 100755
@@ -112,7 +112,9 @@ echo
  echo '=== Partial final cluster ==='
  echo
 
-_make_test_img 1024
+# Force compat=1.1, because writing zeroes on a v2 image without a
+# backing file would just result in an unallocated cluster
+_make_test_img -o compat=1.1 1024
  $QEMU_IO -f $IMGFMT -C -c 'read 0 1024' "$TEST_IMG" | _filter_qemu_io
  $QEMU_IO -f $IMGFMT -c map "$TEST_IMG"
  _check_test_img
Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org