hypervisor, vmm: Limit max number of vCPUs to hypervisor maximum

On KVM this is provided by an ioctl, on MSHV this is constant. Although
there is a HV_MAXIMUM_PROCESSORS constant the MSHV ioctl API is limited
to u8.

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
This commit is contained in:
Rob Bradford
2023-04-11 15:52:01 +01:00
committed by Rob Bradford
parent 2554f2a8d4
commit ceb8151747
4 changed files with 22 additions and 0 deletions

View File

@@ -133,4 +133,7 @@ pub trait Hypervisor: Send + Sync {
fn get_guest_debug_hw_bps(&self) -> usize {
unimplemented!()
}
/// Get maximum number of vCPUs
fn get_max_vcpus(&self) -> u32;
}