mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Add 'memory_zones' option to NumaConfig
This new option provides a new way to describe the memory associated with a NUMA node. This is the first step before we can remove the 'guest_numa_node' option from the --memory-zone parameter. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
@@ -248,3 +248,19 @@ impl FromStr for TupleTwoIntegers {
|
||||
Ok(TupleTwoIntegers(list))
|
||||
}
|
||||
}
|
||||
|
||||
pub struct StringList(pub Vec<String>);
|
||||
|
||||
pub enum StringListParseError {
|
||||
InvalidValue(String),
|
||||
}
|
||||
|
||||
impl FromStr for StringList {
|
||||
type Err = StringListParseError;
|
||||
|
||||
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
|
||||
let string_list: Vec<String> = s.trim().split(':').map(|e| e.to_owned()).collect();
|
||||
|
||||
Ok(StringList(string_list))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user