From 80ea1fe62d9b8d405611cf68aed5c746b17db509 Mon Sep 17 00:00:00 2001 From: Demi Marie Obenour Date: Sat, 14 Feb 2026 02:54:34 -0500 Subject: [PATCH] block: Allow (and ignore) FLUSH requests on read-only devices 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 Signed-off-by: Demi Marie Obenour --- virtio-devices/src/block.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/virtio-devices/src/block.rs b/virtio-devices/src/block.rs index a7da43e6c..06e07eca4 100644 --- a/virtio-devices/src/block.rs +++ b/virtio-devices/src/block.rs @@ -169,7 +169,9 @@ fn has_feature(features: u64, feature_flag: u64) -> bool { impl BlockEpollHandler { 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 + || request_type == RequestType::GetDeviceId + || request_type == RequestType::Flush) { // For virtio spec compliance // "A device MUST set the status byte to VIRTIO_BLK_S_IOERR for a write request