mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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 <anbelski@linux.microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
293672ea76
commit
14dfd78f04
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user