qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-5.1 2/2] iotests: Test sparseness for qemu-img convert -n


From: Max Reitz
Subject: Re: [PATCH for-5.1 2/2] iotests: Test sparseness for qemu-img convert -n
Date: Tue, 21 Jul 2020 13:25:41 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 21.07.20 13:20, Kevin Wolf wrote:
> Am 21.07.2020 um 12:19 hat Max Reitz geschrieben:
>> On 20.07.20 15:18, Kevin Wolf wrote:
>>> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
>>> ---
>>>  tests/qemu-iotests/122     | 34 ++++++++++++++++++++++++++++++++++
>>>  tests/qemu-iotests/122.out | 17 +++++++++++++++++
>>>  2 files changed, 51 insertions(+)
>>>
>>> diff --git a/tests/qemu-iotests/122 b/tests/qemu-iotests/122
>>> index dfd1cd05d6..1112fc0730 100755
>>> --- a/tests/qemu-iotests/122
>>> +++ b/tests/qemu-iotests/122
>>> @@ -281,6 +281,40 @@ $QEMU_IMG convert -O $IMGFMT -n "$TEST_IMG" 
>>> "$TEST_IMG".orig
>>>  
>>>  $QEMU_IMG compare "$TEST_IMG" "$TEST_IMG".orig
>>>  
>>> +echo
>>> +echo '=== -n to an empty image ==='
>>> +echo
>>> +
>>> +_make_test_img 64M
>>> +
>>> +# Convert with -n, which should not result in a fully allocated image, not 
>>> even
>>> +# with compat=0.10 (because the target doesn't have a backing file)
>>> +TEST_IMG="$TEST_IMG".orig _make_test_img -o compat=1.1 64M
>>> +$QEMU_IMG convert -O $IMGFMT -n "$TEST_IMG" "$TEST_IMG".orig
>>> +$QEMU_IMG map --output=json "$TEST_IMG".orig
>>> +
>>> +TEST_IMG="$TEST_IMG".orig _make_test_img -o compat=0.10 64M
>>
>> It’s a shame that with this, the test will no longer pass with
>> refcount_bits=1.  (Or an external data file.)
> 
> You mean because of the compat=0.10? We already use that in this test
> case, however just with "$QEMU_IMG convert" so that $IMGOPTS doesn't
> apply.
> 
> I guess I could just override $IMGOPTS for this line to get the same
> behaviour here and make sure that none of these options are used.

Well... Not my favorite, but probably because I just never thought of that.

I suppose it works, so why not, actually.

Max

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]