mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: support setting cpu affinity with host cpu indices >255
On hosts with >256 cpus, setting the cpu affinity to a host cpu index >255 will return an error because type of `host_cpu` is `u8`. This commit changes the type of `host_cpu` to `usize` to remove this limitation. Signed-off-by: Sean Banko <sbanko@crusoeenergy.com>
This commit is contained in:
@@ -290,6 +290,17 @@ impl TupleValue for Vec<u64> {
|
||||
}
|
||||
}
|
||||
|
||||
impl TupleValue for Vec<usize> {
|
||||
fn parse_value(input: &str) -> Result<Self, TupleError> {
|
||||
Ok(IntegerList::from_str(input)
|
||||
.map_err(TupleError::InvalidIntegerList)?
|
||||
.0
|
||||
.iter()
|
||||
.map(|v| *v as usize)
|
||||
.collect())
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Tuple<S, T>(pub Vec<(S, T)>);
|
||||
|
||||
pub enum TupleError {
|
||||
|
||||
Reference in New Issue
Block a user