pub enum Error {
InvalidSpec(String),
NotFound(VmId),
WrongState {
id: VmId,
state: VmState,
expected: &'static str,
},
ForeignCheckpoint(CheckpointFormat),
Driver {
driver: &'static str,
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
Io(Error),
Network(String),
Unavailable(String),
PreconditionFailed(String),
}Expand description
Errors raised by drivers, handles, and the guest-network port.
Variants§
InvalidSpec(String)
A crate::VmSpec (or a piece of it) failed validation.
NotFound(VmId)
No VM with this id is known to the driver or network.
WrongState
The VM is in a state the operation cannot act on (dialing an exited VM, checkpointing one that already exited).
Fields
ForeignCheckpoint(CheckpointFormat)
A restore was asked of a checkpoint another driver (or another version of this one) wrote.
Driver
The adapter itself failed: process spawn, API call, file staging.
driver is the adapter’s crate::VmDriver::name; source carries
the underlying error when there is one worth chaining.
Fields
Io(Error)
A host I/O failure surfaced unchanged.
Network(String)
The guest-network port refused or failed an operation.
The operation cannot proceed yet, and retrying later is the remedy:
a startup-cleanup gate still closed, a same-id cleanup the host has
not finalized. Separate from Self::Network because a caller
surfaces it as “unavailable, come back” rather than as a fault.
PreconditionFailed(String)
A precondition the caller presented does not hold — a cleanup token
naming another generation, or naming one that no longer exists.
Retrying the same call never helps; the caller needs a current
token. Separate from Self::WrongState, which is about where a
VM sits in its lifecycle.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()