From 293672ea766ff1a6a81119f43137a81642a5f1ee Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 7 May 2026 14:44:30 +0200 Subject: [PATCH] virtio-devices: block: Drop per handler NEEDS_RESET bookkeeping With virtqueue iterator errors now killing the worker and spawn_virtio_thread marking NEEDS_RESET centrally, the per handler needs_reset() gate on process_queue_submit and process_queue_complete is unreachable. Drop needs_reset(), the two early returns, the unused device_status field on BlockEpollHandler and its initializer, and the device_needs_reset import. No functional change. Signed-off-by: Anatol Belski --- virtio-devices/src/block.rs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/virtio-devices/src/block.rs b/virtio-devices/src/block.rs index a0faa7cd4..d1ade5283 100644 --- a/virtio-devices/src/block.rs +++ b/virtio-devices/src/block.rs @@ -50,7 +50,7 @@ use super::{ }; use crate::seccomp_filters::Thread; use crate::thread_helper::spawn_virtio_thread; -use crate::{GuestMemoryMmap, VirtioInterrupt, device_needs_reset}; +use crate::{GuestMemoryMmap, VirtioInterrupt}; const SECTOR_SHIFT: u8 = 9; pub const SECTOR_SIZE: u64 = 0x01 << SECTOR_SHIFT; @@ -165,7 +165,6 @@ struct BlockEpollHandler { host_cpus: Option>, acked_features: u64, disable_sector0_writes: bool, - device_status: Arc, } fn has_feature(features: u64, feature_flag: u64) -> bool { @@ -173,10 +172,6 @@ fn has_feature(features: u64, feature_flag: u64) -> bool { } impl BlockEpollHandler { - fn needs_reset(&self) -> bool { - device_needs_reset(&self.device_status) - } - fn check_request( features: u64, request: &Request, @@ -208,9 +203,6 @@ impl BlockEpollHandler { } fn process_queue_submit(&mut self) -> Result<()> { - if self.needs_reset() { - return Ok(()); - } let queue = &mut self.queue; let queue_size = queue.size(); let mut batch_requests = Vec::new(); @@ -433,9 +425,6 @@ impl BlockEpollHandler { } fn process_queue_complete(&mut self) -> Result<()> { - if self.needs_reset() { - return Ok(()); - } let mem = self.mem.memory(); let mut read_bytes = Wrapping(0); let mut write_bytes = Wrapping(0); @@ -1142,7 +1131,6 @@ impl VirtioDevice for Block { host_cpus: self.queue_affinity.get(&queue_idx).cloned(), acked_features: self.common.acked_features, disable_sector0_writes: self.disable_sector0_writes, - device_status: self.device_status.clone(), }; let paused = self.common.paused.clone();