mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
QCOW2 compressed L2 entries encode their extent layout in bits that overlap with the flags used by standard L2 entries. In particular, bit 0 can be part of the compressed entry layout, so it must not be interpreted as ZERO_FLAG until the entry has first been ruled out as compressed. Keep compressed deallocation ahead of zero-flag handling in both the shared QcowMetadata path and the legacy QcowFile path. This ensures WRITE_ZEROES deallocates compressed clusters instead of treating a compressed entry with bit 0 set as an existing logical-zero marker. Add regression coverage that forces bit 0 on a compressed L2 entry and verifies WRITE_ZEROES still clears the entry through the compressed-cluster path. Assisted-by: Codex:GPT-5 Signed-off-by: Ian Klemm <hi@ianklemm.de>