On 17.03.20 19:16, Alberto Garcia wrote: > This function is only used by qcow2_expand_zero_clusters() to > downgrade a qcow2 image to a previous version. It is however not > possible to downgrade an image with extended L2 entries because older > versions of qcow2 do not have this feature. > > Signed-off-by: Alberto Garcia > --- > block/qcow2-cluster.c | 8 +++++++- > tests/qemu-iotests/061 | 6 ++++++ > tests/qemu-iotests/061.out | 5 +++++ > 3 files changed, 18 insertions(+), 1 deletion(-) [...] > diff --git a/tests/qemu-iotests/061 b/tests/qemu-iotests/061 > index 36b040491f..66bfd23179 100755 > --- a/tests/qemu-iotests/061 > +++ b/tests/qemu-iotests/061 > @@ -266,6 +266,12 @@ $QEMU_IMG amend -o "compat=0.10" "$TEST_IMG" > _img_info --format-specific > _check_test_img > > +echo > +echo "=== Testing version downgrade with extended L2 entries ===" > +echo > +_make_test_img -o "compat=1.1,extended_l2=on" 64M > +$QEMU_IMG amend -o "compat=0.10" "$TEST_IMG" > + > echo > echo "=== Try changing the external data file ===" > echo > diff --git a/tests/qemu-iotests/061.out b/tests/qemu-iotests/061.out > index 8b3091a412..5d009867a2 100644 > --- a/tests/qemu-iotests/061.out > +++ b/tests/qemu-iotests/061.out > @@ -498,6 +498,11 @@ Format specific information: > corrupt: false > No errors were found on the image. > > +=== Testing version downgrade with extended L2 entries === > + > +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 > +qemu-img: Cannot downgrade an image with incompatible features 0x10 set This test fails in this commit, because extended_l2 is only available after the next commit. The code changes and the test itself look good to me, though. Max