pub enum Error {
Show 23 variants
InvalidParam,
InvalidOperation(&'static str),
InactiveFeature(VhostUserVirtioFeatures),
InactiveOperation(VhostUserProtocolFeatures),
InvalidMessage,
InvalidSocketFd(Error),
NotUnixSocket,
NotStreamSocket,
PartialMessage,
Disconnected,
OversizedMsg,
IncorrectFds,
SocketConnect(Error),
SocketError(Error),
SocketBroken(Error),
SocketRetry(Error),
BackendInternalError,
FrontendInternalError,
FeatureMismatch,
ReqHandlerError(Error),
MemFdCreateError,
FileTruncateError,
MemFdSealError,
}Expand description
Errors for vhost-user operations
Variants§
InvalidParam
Invalid parameters.
InvalidOperation(&'static str)
Invalid operation due to some reason
InactiveFeature(VhostUserVirtioFeatures)
Unsupported operation due to missing feature
InactiveOperation(VhostUserProtocolFeatures)
Unsupported operations due to that the protocol feature hasn’t been negotiated.
InvalidMessage
Invalid message format, flag or content.
InvalidSocketFd(Error)
Invalid AF_UNIX SOCK_STREAM socket file descriptor.
NotUnixSocket
Socket is not AF_UNIX
NotStreamSocket
Socket is not SOCK_STREAM
PartialMessage
Only part of a message have been sent or received successfully
Disconnected
The peer disconnected from the socket.
OversizedMsg
Message is too large
IncorrectFds
Fd array in question is too big or too small
SocketConnect(Error)
Can’t connect to peer.
SocketError(Error)
Generic socket errors.
SocketBroken(Error)
The socket is broken or has been closed.
SocketRetry(Error)
Should retry the socket operation again.
BackendInternalError
Failure from the backend side.
FrontendInternalError
Failure from the frontend side.
FeatureMismatch
Virtio/protocol features mismatch.
ReqHandlerError(Error)
Error from request handler
MemFdCreateError
memfd file creation error
FileTruncateError
File truncate error
MemFdSealError
memfd file seal errors
Implementations§
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
use the Display impl or to_string()
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 vmm_sys_util::errno::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.