parse_disk_arg

Function parse_disk_arg 

Source
pub fn parse_disk_arg(s: Option<&str>) -> Result<Option<DiskConfig>>
Expand description

Parse the --disk <SIZE> CLI argument into an Option<crate::vmm::disk_config::DiskConfig>. None input returns Ok(None) (no disk attached); a Some(s) input runs s through parse_disk_size_mib and wraps the result in a DiskConfig whose remaining fields fall through to crate::vmm::disk_config::DiskConfig::default (raw filesystem, no throttle, read-write). Shared between cargo ktstr shell and ktstr shell so both bins parse identically; a malformed size surfaces here at CLI-argument time, never mid-VM-setup.