Files
cloud-hypervisor/virtio-devices
CMGS e4e2a37afa block: Restrict DISCARD to explicit sparse=true
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>
2026-03-31 18:57:52 +00:00
..