mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
PR #7852 fixed the missing VirtioBlockConfig fields but did not change the feature advertisement logic. The condition `sparse || disk_image.supports_zero_flag()` causes qcow2 to advertise DISCARD even with sparse=false, because qcow2 can mark clusters as zero (supports_zero_flag() returns true). Windows viostor BSODs (DRIVER_IRQL_NOT_LESS_OR_EQUAL) when DISCARD is advertised on qcow2 backends, making sparse=off ineffective as a workaround for qcow2 images. Restrict DISCARD to explicit sparse=true only. WRITE_ZEROES remains available for all sparse-capable backends. Fixes #7849 Signed-off-by: CMGS <ilskdw@gmail.com>