mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: add nested option to CPU config
Add an option in the CLI to enable nested support. Adding an option --cpu nested=on|off to the CPU argument to enable nested support for Microsoft Hypervisor. By default it is enabled for both KVM and MSHV. Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
0d5c914bdd
commit
f10d0bb33d
@@ -69,6 +69,8 @@ pub struct CpusConfig {
|
||||
pub affinity: Option<Vec<CpuAffinity>>,
|
||||
#[serde(default)]
|
||||
pub features: CpuFeatures,
|
||||
#[serde(default = "default_cpusconfig_nested")]
|
||||
pub nested: bool,
|
||||
}
|
||||
|
||||
pub const DEFAULT_VCPUS: u32 = 1;
|
||||
@@ -83,6 +85,7 @@ impl Default for CpusConfig {
|
||||
max_phys_bits: DEFAULT_MAX_PHYS_BITS,
|
||||
affinity: None,
|
||||
features: CpuFeatures::default(),
|
||||
nested: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -177,6 +180,10 @@ fn default_memoryconfig_thp() -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn default_cpusconfig_nested() -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
|
||||
pub struct MemoryConfig {
|
||||
pub size: u64,
|
||||
|
||||
Reference in New Issue
Block a user