spt-launch
QEMU microVM launcher for SPT cognitive containers
Overview
spt-launch extracts a kernel image from an SPT file's KERNEL_SEG, builds a QEMU command line, launches the microVM, and provides a management handle for querying status, shutdown, and kill via QMP (QEMU Machine Protocol). It supports KVM acceleration with TCG fallback, configurable vCPU/memory, and port forwarding for API and SSH access.
Key Features
- Kernel extraction -- extracts kernel and initramfs from SPT store segments
- QEMU command builder -- assembles platform-appropriate QEMU invocation
- QMP management -- query VM status, graceful shutdown, and force kill
- KVM acceleration -- auto-detects KVM with TCG fallback
- Requirements checker -- validates QEMU installation and KVM availability
Dependencies
Key internal dependencies:
spt-types-- kernel architecture types (KernelArch)spt-runtime-- SPT store access for kernel segment extractiontempfile-- temporary directories for extracted kernel files
Usage
rust
use spt_launch::{LaunchConfig, MicroVm};
let config = LaunchConfig {
spt_path: "model.spt".into(),
memory_mb: 256,
vcpus: 2,
api_port: 8080,
..Default::default()
};
// let vm = MicroVm::launch(config)?;API Reference
Core Types
| Type | Description |
|---|---|
LaunchConfig | Configuration for microVM launch (memory, CPUs, ports, paths) |
MicroVm | Handle to a running QEMU microVM process |
VmStatus | Current VM state (Running or Exited) |
RequirementsReport | Result of QEMU/KVM availability check |
LaunchError | Error type for extraction and launch failures |