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:
parent
5d7215915f
commit
dc42324351
3 changed files with 35 additions and 3 deletions
|
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue