[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] qcow2: Forbid discard in qcow2 v2 images with backing files
From: |
Alberto Garcia |
Subject: |
Re: [PATCH] qcow2: Forbid discard in qcow2 v2 images with backing files |
Date: |
Tue, 24 Mar 2020 16:13:14 +0100 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Tue 24 Mar 2020 03:46:07 PM CET, Eric Blake wrote:
>> -$QEMU_IO -c 'discard 0k 64k' "$TEST_IMG" | _filter_qemu_io
>> +poke_file "$TEST_IMG" '262144' "\x00\x00\x00\x00\x00\x00\x00\x00" # 0x40000
>> - L2 entry
>> +poke_file "$TEST_IMG" '131082' "\x00\x00" # 0x2000a - Refcount entry
>
> Instead of writing '262144' ... # 0x40000, you could write
> $((0x40000)) in-place. Similarly for 131082 vs. 0x2000a.
The exiting poke_file line in that test was using base 10 so I decided
to use it too for consistency.
I actually realized that $rb_offset and $l2_offset are defined, so I
could use those too.
> Also, Max has pending patches for adding poke_file_be; if those land
> first, this becomes simpler as:
>
> poke_file_be "$TEST_IMG" $((0x40000)) 8 0 # L2 entry
> poke_file_be "$TEST_IMG" $((0x2000a)) 2 0 # Refcount entry
I'm fine if those lines are changed when the patch is committed.
Berto