virtio-devices: mem: Remove dead error variants and unused import

Remove UnknownRequestType (no longer returned after responding with
ERROR), EventFdWriteFail, EventFdTryCloneFail, MpscRecvFail, and
NotActivatedByGuest which have no call sites. Drop the now-unused
mpsc import.

Signed-off-by: Rob Bradford <rbradford@meta.com>
Assisted-by: Claude:claude-opus-4-6
This commit is contained in:
Rob Bradford
2026-05-06 14:20:12 +01:00
parent 6a1fe123c2
commit fe7745b472
+1 -13
View File
@@ -18,7 +18,7 @@ use std::collections::BTreeMap;
use std::mem::size_of; use std::mem::size_of;
use std::os::unix::io::{AsRawFd, RawFd}; use std::os::unix::io::{AsRawFd, RawFd};
use std::sync::atomic::AtomicBool; use std::sync::atomic::AtomicBool;
use std::sync::{Arc, Barrier, Mutex, mpsc}; use std::sync::{Arc, Barrier, Mutex};
use std::{io, result}; use std::{io, result};
use anyhow::anyhow; use anyhow::anyhow;
@@ -115,16 +115,8 @@ pub enum Error {
BufferLengthTooSmall, BufferLengthTooSmall,
#[error("Guest sent us invalid request")] #[error("Guest sent us invalid request")]
InvalidRequest, InvalidRequest,
#[error("Failed to EventFd write")]
EventFdWriteFail(#[source] std::io::Error),
#[error("Failed to EventFd try_clone")]
EventFdTryCloneFail(#[source] std::io::Error),
#[error("Failed to MpscRecv")]
MpscRecvFail(#[source] mpsc::RecvError),
#[error("Resize invalid argument")] #[error("Resize invalid argument")]
ResizeError(#[source] anyhow::Error), ResizeError(#[source] anyhow::Error),
#[error("Fail to resize trigger")]
ResizeTriggerFail(#[source] DeviceError),
#[error("Invalid configuration")] #[error("Invalid configuration")]
ValidateError(#[source] anyhow::Error), ValidateError(#[source] anyhow::Error),
#[error("Failed discarding memory range")] #[error("Failed discarding memory range")]
@@ -135,10 +127,6 @@ pub enum Error {
DmaUnmap(#[source] std::io::Error), DmaUnmap(#[source] std::io::Error),
#[error("Invalid DMA mapping handler")] #[error("Invalid DMA mapping handler")]
InvalidDmaMappingHandler, InvalidDmaMappingHandler,
#[error("Not activated by the guest")]
NotActivatedByGuest,
#[error("Unknown request type: {0}")]
UnknownRequestType(u16),
#[error("Failed adding used index")] #[error("Failed adding used index")]
QueueAddUsed(#[source] virtio_queue::Error), QueueAddUsed(#[source] virtio_queue::Error),
} }