[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3] qcow2: Forbid discard in qcow2 v2 images with backing fil
Re: [PATCH v3] qcow2: Forbid discard in qcow2 v2 images with backing files
Fri, 27 Mar 2020 13:52:14 -0500
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0
On 3/27/20 1:43 PM, Alberto Garcia wrote:
On Fri 27 Mar 2020 07:13:04 PM CET, Eric Blake wrote:
+for qcow2_compat in 0.10 1.1; do
+ echo "# Create an image with compat=$qcow2_compat without a backing file"
+ _make_test_img -o "compat=$qcow2_compat" 128k
+ echo "# Fill all clusters with data and then discard them"
+ $QEMU_IO -c 'write -P 0x01 0 128k' "$TEST_IMG" | _filter_qemu_io
+ $QEMU_IO -c 'discard 0 128k' "$TEST_IMG" | _filter_qemu_io
+ echo "# Read the data from the discarded clusters"
+ $QEMU_IO -c 'read -P 0x00 0 128k' "$TEST_IMG" | _filter_qemu_io
Should this loop also inspect qemu-img map output?
I guess we can, although here the image is completely unallocated in
Which shows that even for v2 images, discard DOES do something when
there is no backing file (even if it is now a no-op when there is a
backing file after this patch).
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org