qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 2/2] iotests/244: Test preallocation for data-file-raw


From: Max Reitz
Subject: Re: [PATCH v2 2/2] iotests/244: Test preallocation for data-file-raw
Date: Fri, 26 Mar 2021 21:06:07 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0

On 26.03.21 16:17, Eric Blake wrote:
On 3/26/21 9:55 AM, Max Reitz wrote:
Three test cases:
(1) Adding a qcow2 (metadata) file to an existing data file, see whether
     we can read the existing data through the qcow2 image.
(2) Append data to the data file, grow the qcow2 image accordingly, see
     whether we can read the new data through the qcow2 image.
(3) At runtime, add a backing image to a freshly created qcow2 image
     with an external data file (with data-file-raw).  Reading data from
     the qcow2 image must return the same result as reading data from the
     data file, so everything in the backing image must be ignored.
     (This did not use to be the case, because without the L2 tables
     preallocated, all clusters would appear as unallocated, and so the
     qcow2 driver would fall through to the backing file.)

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
  tests/qemu-iotests/244     | 104 +++++++++++++++++++++++++++++++++++++
  tests/qemu-iotests/244.out |  59 +++++++++++++++++++++
  2 files changed, 163 insertions(+)


+
+# We cannot use qemu-img to create the qcow2 image, because it would
+# clear the data file.  Use the blockdev-create job instead, which will
+# only format the qcow2 image file.

Well, perhaps we could use qemu-img to create a qcow2 pointing to a
temporary file, then rewrite it to point to the real data file, but that
feels hackish, and your approach worked.  And besides, while we have
qemu-img rebase -u to rewrite the backing file, I don't know if we have
a similar qemu-img command for rewriting the data file.

Yes, we do, but I decided this would be the cleanest way.

Reviewed-by: Eric Blake <eblake@redhat.com>

Thanks! I’ll decide on Monday whether to include this in 6.0. I think it would be small enough for rc1, but it’s also no regression, so... Well, I’ll see then.

Max




reply via email to

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