Skip to content

block: Allow (and ignore) FLUSH requests on read-only devices#7706

Merged
rbradford merged 1 commit intocloud-hypervisor:mainfrom
DemiMarie:flush-ro
Feb 14, 2026
Merged

block: Allow (and ignore) FLUSH requests on read-only devices#7706
rbradford merged 1 commit intocloud-hypervisor:mainfrom
DemiMarie:flush-ro

Conversation

@DemiMarie
Copy link
Copy Markdown
Contributor

OVMF sends FLUSH requests to read-only virtio-block devices. Refusing these requests prevents OVMF from accessing the EFI System Partition and therefore makes VMs unable to boot. Accept these requests instead. them.

Ignoring these requests is possible, but inconsistent with fsync(2) which honors them.

Fixes: #7698

@DemiMarie DemiMarie marked this pull request as ready for review February 14, 2026 08:26
@DemiMarie DemiMarie requested a review from a team as a code owner February 14, 2026 08:26
fn check_request(features: u64, request_type: RequestType) -> result::Result<(), ExecuteError> {
if has_feature(features, VIRTIO_BLK_F_RO.into())
&& !(request_type == RequestType::In || request_type == RequestType::GetDeviceId)
&& !(request_type == RequestType::In
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.

Yes the spec says only write requests (which I interpret to being discard too) that this should apply to.

@rbradford rbradford added this pull request to the merge queue Feb 14, 2026
OVMF sends FLUSH requests to read-only virtio-block devices.  Refusing
these requests prevents OVMF from accessing the EFI System Partition and
therefore makes VMs unable to boot.  Accept these requests instead.
them.

Ignoring these requests is possible, but inconsistent with fsync(2)
which honors them.

Fixes: cloud-hypervisor#7698
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
@DemiMarie
Copy link
Copy Markdown
Contributor Author

Force-pushed to fix commit message.

Merged via the queue into cloud-hypervisor:main with commit 80ea1fe Feb 14, 2026
2 checks passed
@likebreath likebreath added the bug-fix Bug fix to include in release notes label Feb 19, 2026
@DemiMarie DemiMarie deleted the flush-ro branch March 6, 2026 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix Bug fix to include in release notes

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Cloud Hypervisor rejects virtio-blk flush requests on read-only block devices

3 participants