pub enum VmmError {
Show 25 variants
NotFound(String),
AlreadyExists(String),
WrongState {
id: String,
expected: String,
actual: String,
},
Paused(String),
Io(Error),
Json(Error),
Driver(Error),
Network(String),
Snapshot(String),
DeviceMapper(String),
Rootfs(String),
Process(String),
Config(String),
Vsock(String),
PathNotFound(String),
NotADirectory(String),
DirectoryNotEmpty(String),
TemplateNotFound(String),
TemplateVersionExists(String),
FailedPrecondition(String),
DeadlineExceeded(String),
Unavailable(String),
AckUnconfirmed {
id: String,
detail: String,
},
StdinGap {
accepted: u64,
offset: u64,
},
Other(String),
}Expand description
Core VMM error type.
Variants§
NotFound(String)
The requested VM was not found.
AlreadyExists(String)
A VM with the given name already exists.
WrongState
The VM is not in a state that allows the requested operation.
Paused(String)
The sandbox is paused. Distinct from Self::WrongState so callers
(the daemon’s transparent auto-resume, CORE-21) can recognise
“paused” machine-readably instead of parsing state strings.
Io(Error)
I/O error (file system, sockets, etc.).
Json(Error)
JSON serialisation/deserialisation error.
Driver(Error)
The VM driver — the port’s adapter, or a capability reached through
it — failed in a way that has no native shape here (an adapter
fault, a foreign checkpoint). The port’s NotFound, WrongState,
Io, Network and InvalidSpec land on their native variants
instead (see the From impl), so the guest agent’s wire mapping
keeps answering 404 / 412 for them rather than 500.
Network(String)
Network-related error (TAP creation, IP allocation, etc.).
Snapshot(String)
Snapshot catalog error.
DeviceMapper(String)
Device-mapper / dm-snapshot error.
Rootfs(String)
Building a sandbox rootfs image (OCI/overlay2 → ext4, vm-agent injection, the default busybox image) failed.
Process(String)
Process lifecycle error.
Config(String)
Configuration error.
Vsock(String)
Vsock / guest-agent communication error.
PathNotFound(String)
A path inside a sandbox does not exist. The message shape is a
contract: the daemon’s error classifier keys on the “path not
found:” prefix to attach the FILE_NOT_FOUND registry code.
NotADirectory(String)
A directory operation addressed a non-directory path.
DirectoryNotEmpty(String)
Refused to remove a non-empty directory without recursive
(FAILED_PRECONDITION per the filesystem contract).
TemplateNotFound(String)
A catalog template reference did not resolve. The message shape is a
contract: the daemon’s classifier keys on the “template not found:”
prefix to attach the TEMPLATE_NOT_FOUND registry code (CORE-107).
TemplateVersionExists(String)
Publishing would repoint an existing immutable template version at different content (409 on the daemon surface).
FailedPrecondition(String)
A required precondition does not hold and retrying the same request
never helps (FAILED_PRECONDITION on the daemon surface).
DeadlineExceeded(String)
A bounded wait elapsed before the awaited condition held
(DEADLINE_EXCEEDED on the daemon surface).
A retryable operation whose durable result could not be confirmed.
AckUnconfirmed
The operation’s side effects committed — the sandbox exists and is
running — but the acknowledging record’s durability is unconfirmed.
Distinct from VmmError::Unavailable so callers with a fallback
(warm create) can tell “nothing happened, retry freely” from “it
happened, do NOT re-execute”.
Fields
StdinGap
A stdin write starts past the accepted byte count — the caller must
resume from accepted (its offsets have a gap).
Fields
Other(String)
Generic catch-all error.
Trait Implementations§
Source§impl Error for VmmError
impl Error for VmmError
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<AtomicWriteError> for VmmError
A durable write that never landed is an I/O failure; one that landed
without a confirmed rename is VmmError::Unavailable — the caller
may retry, and the retry is safe because the write is idempotent.
impl From<AtomicWriteError> for VmmError
A durable write that never landed is an I/O failure; one that landed
without a confirmed rename is VmmError::Unavailable — the caller
may retry, and the retry is safe because the write is idempotent.
Callers that can do better than this (the sandbox record store keeps
the record and warns) match on [AtomicWriteError] themselves instead
of going through here.
Source§fn from(err: AtomicWriteError) -> Self
fn from(err: AtomicWriteError) -> Self
Source§impl From<Error> for VmmError
Variant-for-variant where a native shape exists, so a driver-reported
NotFound or WrongState keeps the wire code the equivalent native
error already has (the guest agent classifies VmmError by variant;
anything it does not know becomes a 500), and so do the guest
network’s two protocol answers — retry-later and failed precondition,
the 503 and 412 of the cleanup-token protocol. What has no native
shape — an adapter fault, a checkpoint another driver wrote — stays
VmmError::Driver with the port error intact for its source chain.
impl From<Error> for VmmError
Variant-for-variant where a native shape exists, so a driver-reported
NotFound or WrongState keeps the wire code the equivalent native
error already has (the guest agent classifies VmmError by variant;
anything it does not know becomes a 500), and so do the guest
network’s two protocol answers — retry-later and failed precondition,
the 503 and 412 of the cleanup-token protocol. What has no native
shape — an adapter fault, a checkpoint another driver wrote — stays
VmmError::Driver with the port error intact for its source chain.
Source§impl From<SnapshotError> for VmmError
Variant-for-variant, so a snapshot or template failure keeps the exact
shape callers already match on — the daemon maps TemplateNotFound
and TemplateVersionExists onto their own wire codes, and folding
either into a generic error would change the surface.
impl From<SnapshotError> for VmmError
Variant-for-variant, so a snapshot or template failure keeps the exact
shape callers already match on — the daemon maps TemplateNotFound
and TemplateVersionExists onto their own wire codes, and folding
either into a generic error would change the surface.