Expand description
RuntimeApiController — channel to VMM + lock-free read mirror + timeout taxonomy.
Per 20-firecracker-api.md § 5:
ArcSwap<ControllerSnapshot>lock-free read mirror; written by the VMM event loop on every state transition, read by everyGEThandler.tokio::sync::mpsc::Sender<(ApiAction, oneshot::Sender<ApiResponse>)>single-writer channel into the VMM event loop. Bounded (capacity 1024 per CLAUDE.md § Async).- Per-action-class
tokio::time::timeout(D26); on timeout we surface 504 and log the still-pending action aterror.
Pre-boot vs post-boot admissibility is checked synchronously against the
LifecyclePhase carried in ControllerSnapshot — no VMM round-trip needed for
rejection.
Structs§
- Controller
Snapshot - Lock-free read mirror surfaced via every
GEThandler. - Limits
Snapshot - Read-only view of
LimitsStatefor callers that want a momentary snapshot. - Limits
State - Cross-field limits that the controller enforces synchronously, before an action is
forwarded to the VMM event loop. These are the upper bounds that the per-field
Raw* → Validated TryFromconversions cannot enforce because they need the running machine state (host RAM cap, configuredmem_size_mib, running counts). - Runtime
ApiController - Controller surfaced to handlers. Written by the VMM event loop, read by every handler.
- Timeout
Table - Per-class
tokio::time::timeoutbudget per 70-security.md § 6.
Type Aliases§
- Action
Receiver - Channel receiver type owned by the VMM event loop.
- Action
Sender - Channel sender type used by mutating handlers.