On 25.04.2025 03:52, Eric Blake wrote:
Prove that blockdev-mirror can now result in sparse raw destination
files, regardless of whether the source is raw or qcow2.  By making
this a separate test, it was possible to test effects of individual
patches for the various pieces that all have to work together for a
sparse mirror to be successful.

Note that ./check -file produces different job lengths than ./check
-qcow2 (the test uses a filter to normalize); that's because when
deciding how much of the image to be mirrored, the code looks at how
much of the source image was allocated (for qcow2, this is only the
written clusters; for raw, it is the entire file).  But the important
part is that the destination file ends up smaller than 3M, rather than
the 20M it used to be before this patch series.

Signed-off-by: Eric Blake <ebl...@redhat.com>

Hi!

This test requires O_DIRECT to be available on the underlying filesystem

Without O_DIRECT support, the test fails with:

Listing only the last 100 lines from a long log.
-{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "pending", "id": "job2"}}
...
-*** done
+Timeout waiting for capabilities on handle 0

which is not helping at all.

This hit me on debian, where automatic buildds run everything on
a tmpfs which does not support O_DIRECT, and the test failed this
way, without a way to tell what's wrong.

After adding save_stderr=y to the test, I finally were able to see
what's going on:

+qemu-system-x86_64: -blockdev {"driver":"file", "cache":{"direct":true, "no-flush":false}, + "filename":"/build/reproducible-path/qemu-10.1.0~rc1+ds/scratch/qcow2-file-mirror-sparse/t.qcow2.base", "node-name":"src-file"}: Could not open '/build/reproducible-path/qemu-10.1.0~rc1+ds/scratch/qcow2-file-mirror-sparse/t.qcow2.base': filesystem does not support O_DIRECT
+Timeout waiting for capabilities on handle 0
make: *** [debian/rules:188: b/qemu/tested] Error 1


but it took me multiple rather painful iterations because each time
I had to upload new version of the source package to debian for the
builddds to pick it up (similar to what we have in the CI but without
saving the build artifacts).

This test should somehow depend on O_DIRECT availability - we already
had something similar with 9pfs which also required O_DIRECT and
failed when /tmp was on a tmpfs.

And I think generally stderr should always be visible, at least when
the test failed, - where it is especially needed to diagnose the issue.

In debian I disabled mirror-sparse test entirely (also had to do a few
iterations, because it turned out removing the test files has to be
done before ./configure run).

Thanks,

/mjt

Reply via email to