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:
Sebastien Boeuf 2020-09-04 09:36:10 +02:00
parent 5d7215915f
commit dc42324351
3 changed files with 35 additions and 3 deletions

View file

@ -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))
}
}