From 14dfd78f045b2aa68fe5d129b14d24d42336e80b Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 7 May 2026 14:49:18 +0200 Subject: [PATCH] virtio-devices: Drop unused device_needs_reset helper With the per handler needs_reset() gates removed from net and block, nothing reads DEVICE_NEEDS_RESET anymore. Drop the device_needs_reset helper and refresh the doc comment on mark_device_needs_reset to reflect the central call site in spawn_virtio_thread, where it runs after the worker has already exited. No functional change. Signed-off-by: Anatol Belski --- virtio-devices/src/lib.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/virtio-devices/src/lib.rs b/virtio-devices/src/lib.rs index 3d6296dff..6ac397798 100644 --- a/virtio-devices/src/lib.rs +++ b/virtio-devices/src/lib.rs @@ -70,15 +70,10 @@ const DEVICE_FEATURES_OK: u32 = 0x08; const DEVICE_NEEDS_RESET: u32 = 0x40; const DEVICE_FAILED: u32 = 0x80; -/// Returns true if `device_status` has the `DEVICE_NEEDS_RESET` bit set. -pub(crate) fn device_needs_reset(device_status: &AtomicU8) -> bool { - (device_status.load(Ordering::Acquire) & DEVICE_NEEDS_RESET as u8) != 0 -} - /// Marks a virtio device as `NEEDS_RESET` and notifies the guest via a config /// change interrupt. Used when a guest induced error (corrupted virtqueue, -/// malformed descriptor chain or similar) is detected and the device wants -/// to stop further queue processing without killing the worker thread. +/// malformed descriptor chain or similar) is detected and the worker thread +/// has stopped processing the device's queues. /// /// `context` is included verbatim in the warning log to identify the cause. pub(crate) fn mark_device_needs_reset(