pub struct MicrovmConfig {
pub vcpu_count: u8,
pub memory_mb: u32,
pub cpu_quota_us: Option<u64>,
pub kernel_path: PathBuf,
pub rootfs_path: PathBuf,
}Expand description
Configuration for a single microVM instance.
The configuration describes the guest CPU and memory shape plus the host-side assets required to boot the guest kernel and root filesystem. It is validated before any backend is created.
Fields§
§vcpu_count: u8Number of virtual CPUs exposed to the guest.
memory_mb: u32Guest memory size in mebibytes.
cpu_quota_us: Option<u64>Optional CPU time quota in microseconds for backends that support CPU throttling.
kernel_path: PathBufPath to the guest kernel image on the host.
rootfs_path: PathBufPath to the gzip-compressed guest rootfs image on the host.
Implementations§
Source§impl MicrovmConfig
impl MicrovmConfig
Sourcepub fn memory_bytes(&self) -> Result<usize, MicrovmError>
pub fn memory_bytes(&self) -> Result<usize, MicrovmError>
Returns the configured guest memory size in bytes.
The conversion checks for arithmetic overflow and for platforms where the
requested memory size cannot fit into usize.
Sourcepub fn validate(&self) -> Result<(), MicrovmError>
pub fn validate(&self) -> Result<(), MicrovmError>
Validates the base microVM configuration before backend creation.
Validation rejects zero vCPU count, memory below the minimum supported guest size, empty asset paths, and missing kernel or rootfs files.
Trait Implementations§
Source§impl Clone for MicrovmConfig
impl Clone for MicrovmConfig
Source§fn clone(&self) -> MicrovmConfig
fn clone(&self) -> MicrovmConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more