FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

block: only advertise VIRTIO_BLK_F_DISCARD when sparse=true by CMGS · Pull Request #7936 · cloud-hypervisor/cloud-hypervisor · GitHub

block: only advertise VIRTIO_BLK_F_DISCARD when sparse=true - #7936

Merged
rbradford merged 1 commit into
cloud-hypervisor:mainfrom
cocoonstack:fix/discard-qcow2-sparse
Mar 31, 2026
Merged

block: only advertise VIRTIO_BLK_F_DISCARD when sparse=true#7936
rbradford merged 1 commit into
cloud-hypervisor:mainfrom
cocoonstack:fix/discard-qcow2-sparse

Conversation

CMGS commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

PR #7852 fixed the missing VirtioBlockConfig fields for DISCARD but did not change the feature advertisement logic. The condition sparse || disk_image.supports_zero_flag() causes qcow2 images to advertise DISCARD even with sparse=false, because qcow2 can mark clusters as zero without deallocating (supports_zero_flag() returns true).

Windows viostor driver BSODs with DRIVER_IRQL_NOT_LESS_OR_EQUAL when DISCARD is advertised on qcow2 backends. This makes sparse=off ineffective as a workaround for qcow2 images.

Restrict DISCARD advertisement to explicit sparse=true only. WRITE_ZEROES remains available for all sparse-capable backends.

Fixes: #7849

Comment thread virtio-devices/src/block.rs Outdated
CMGS force-pushed the fix/discard-qcow2-sparse branch 3 times, most recently from 0462bb6 to 679cd67 Compare March 31, 2026 12:32
PR cloud-hypervisor#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 cloud-hypervisor#7849

Signed-off-by: CMGS <ilskdw@gmail.com>
CMGS force-pushed the fix/discard-qcow2-sparse branch from 679cd67 to 1ec5e8d Compare March 31, 2026 13:41

weltling left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

rbradford added this pull request to the merge queue Mar 31, 2026
Merged via the queue into cloud-hypervisor:main with commit e4e2a37 Mar 31, 2026
38 checks passed
CMGS deleted the fix/discard-qcow2-sparse branch April 1, 2026 02:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows Server 2025 won't boot with raw disk image (regression in v51)

3 participants


Back | FazBrowse Home | New Git URL