mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
Add comprehensive integration tests for DISCARD and WRITE_ZEROES: Multiqueue stress tests verify concurrent operations across queues, testing scattered writes with simultaneous fstrim, and write/discard races that stress refcount table locking. Format specific tests verify QCOW2 deallocates clusters after DISCARD, raw files create holes using fallocate, and unsupported formats VHD and VHDX correctly reject DISCARD requests. Tests for sparse=off verify raw files preallocate full disk size and QCOW2 uses zero flag instead of deallocating clusters. Add helper functions to verify sparse files, count QCOW2 zero flagged regions using qemu-img map, and verify guest reads zeros from discarded regions. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>