pub enum Error {
Show 30 variants
BackendInternalError,
ClientExit,
DeserializationFailed,
Disconnect,
EnterSuspendedState(Error),
FeatureMismatch,
FrontendInternalError,
IncorrectFds,
InvalidCastToInt(TryFromIntError),
InvalidMessage,
InvalidOperation,
InvalidParam,
OversizedMsg,
PartialMessage,
RecvBufferTooSmall {
got: usize,
want: usize,
},
ReqHandlerError(Error),
RestoreError(Error),
SerializationFailed,
SleepError(Error),
SnapshotError(Error),
SocketBroken(Error),
SocketConnect(Error),
SocketError(Error),
SocketFromFdError(PathBuf),
SocketRetry(Error),
StopQueueError(Error),
TubeError(TubeError),
VfioDeviceError(Error),
VringIndexNotFound(usize),
WakeError(Error),
}
Expand description
Errors for vhost-user operations
Variants§
BackendInternalError
Failure from the backend side.
ClientExit
client exited properly.
DeserializationFailed
Failure to deserialize data.
Disconnect
client disconnected.
If connection is closed properly, use ClientExit
instead.
EnterSuspendedState(Error)
FeatureMismatch
Virtio/protocol features mismatch.
FrontendInternalError
Failure from the frontend side.
IncorrectFds
Fd array in question is too big or too small
InvalidCastToInt(TryFromIntError)
Invalid cast to int.
InvalidMessage
Invalid message format, flag or content.
InvalidOperation
Unsupported operations due to that the protocol feature hasn’t been negotiated.
InvalidParam
Invalid parameters.
OversizedMsg
Message is too large
PartialMessage
Only part of a message have been sent or received successfully
RecvBufferTooSmall
Provided recv buffer was too small, and data was dropped.
ReqHandlerError(Error)
Error from request handler
RestoreError(Error)
Failure to restore.
SerializationFailed
Failure to serialize data.
SleepError(Error)
Failure to run device specific sleep.
SnapshotError(Error)
Failure to snapshot.
SocketBroken(Error)
The socket is broken or has been closed.
SocketConnect(Error)
Can’t connect to peer.
SocketError(Error)
Generic socket errors.
SocketFromFdError(PathBuf)
Fail to get socket from the fd
SocketRetry(Error)
Should retry the socket operation again.
StopQueueError(Error)
Failure to stop a queue.
TubeError(TubeError)
Error from tx/rx on a Tube.
VfioDeviceError(Error)
Error from VFIO device.
VringIndexNotFound(usize)
Error from invalid vring index.
WakeError(Error)
Failure to run device specific wake.
Trait Implementations§
source§impl Error for Error
impl Error for Error
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl From<Error> for Error
impl From<Error> for Error
source§fn from(err: Error) -> Self
fn from(err: Error) -> Self
Convert raw socket errors into meaningful vhost-user errors.
The base::Error is a simple wrapper over the raw errno, which doesn’t means much to the vhost-user connection manager. So convert it into meaningful errors to simplify the connection manager logic.
§Return:
-
- Error::SocketRetry: temporary error caused by signals or short of resources.
-
- Error::SocketBroken: the underline socket is broken.
-
- Error::SocketError: other socket related errors.