qemu/tests
Eric Blake 181a63667a mirror: Skip pre-zeroing destination if it is already zero
When doing a sync=full mirroring, we can skip pre-zeroing the
destination if it already reads as zeroes and we are not also trying
to punch holes due to detect-zeroes.  With this patch, there are fewer
scenarios that have to pass in an explicit target-is-zero, while still
resulting in a sparse destination remaining sparse.

A later patch will then further improve things to skip writing to the
destination for parts of the image where the source is zero; but even
with just this patch, it is possible to see a difference for any
source that does not report itself as fully allocated, coupled with a
destination BDS that can quickly report that it already reads as zero.
(For a source that reports as fully allocated, such as a file, the
rest of mirror_dirty_init() still sets the entire dirty bitmap to
true, so even though we avoided the pre-zeroing, we are not yet
avoiding all redundant I/O).

Iotest 194 detects the difference made by this patch: for a file
source (where block status reports the entire image as allocated, and
therefore we end up writing zeroes everywhere in the destination
anyways), the job length remains the same.  But for a qcow2 source and
a destination that reads as all zeroes, the dirty bitmap changes to
just tracking the allocated portions of the source, which results in
faster completion and smaller job statistics.  For the test to pass
with both ./check -file and -qcow2, a new python filter is needed to
mask out the now-varying job amounts (this matches the shell filters
_filter_block_job_{offset,len} in common.filter).  A later test will
also be added which further validates expected sparseness, so it does
not matter that 194 is no longer explicitly looking at how many bytes
were copied.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-ID: <20250509204341.3553601-25-eblake@redhat.com>
Reviewed-by: Sunny Zhu <sunnyzhyy@qq.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
2025-05-14 20:20:14 -05:00
..
bench tests/bench: Rename test_akcipher_keys.inc -> test_akcipher_keys.c.inc 2024-09-20 10:08:24 +03:00
data target/riscv: use RVB in RVA22U64 2025-03-04 15:42:54 +10:00
decode tests/: spelling fixes 2023-09-08 13:08:52 +03:00
docker tests: Add Dockerfile containing dependencies for Emscripten build 2025-05-06 16:02:04 +02:00
fp fpu: allow flushing of output denormals to be after rounding 2025-02-11 16:22:07 +00:00
functional tests/functional: Use -no-shutdown in the hppa_seabios test 2025-05-08 15:38:40 -04:00
guest-debug tests/tcg: Add late gdbstub attach test 2025-02-10 13:47:59 +00:00
image-fuzzer image-fuzzer: Use OSerror.strerror instead of tuple subscript 2019-11-05 16:36:11 +01:00
include tests: add missing generated sources to testqapi 2020-10-17 10:45:50 -04:00
keys tests/vm: Add Haiku test based on their vagrant images 2020-11-17 09:45:24 +01:00
lcitool lcitool: use newer Rust for Debian and Ubuntu 2025-05-06 16:02:04 +02:00
migration-stress guestperf: Add test result data into report 2025-02-14 15:19:07 -03:00
multiboot Remove superfluous .gitignore files 2020-10-13 12:48:17 +02:00
perf/block/qcow2
qapi-schema docs/sphinx/qmp_lexer: Generalize elision syntax 2025-04-08 09:04:34 +02:00
qemu-iotests mirror: Skip pre-zeroing destination if it is already zero 2025-05-14 20:20:14 -05:00
qtest Qtest pull request 2025-05-12 11:11:37 -04:00
rocker
tcg hw/loongarch/virt: Get physical entry address with elf file 2025-05-06 09:17:32 +08:00
tsan block: remove AioContext locking 2023-12-21 22:49:27 +01:00
uefi-test-tools tests/data/uefi-boot-images: Add RISC-V ISO image 2024-07-03 18:14:06 -04:00
unit mirror: Drop redundant zero_target parameter 2025-05-14 20:10:12 -05:00
vm tests/vm: bump timeout for shutdown 2025-03-10 10:30:00 +00:00
vmstate-static-checker-data hw: Replace anti-social QOM type names 2021-03-19 15:18:43 +01:00
dbus-vmstate-daemon.sh tests: add dbus-vmstate-test 2020-01-06 18:41:32 +04:00
Makefile.include Remove the remainders of the Avocado tests 2025-04-23 07:51:25 +02:00
meson.build qapi: expose all schema features to code 2025-02-10 15:45:04 +01:00
test-qht-par.c
vhost-user-bridge.c error handling: Use RETRY_ON_EINTR() macro where applicable 2023-01-09 13:50:47 +01:00