mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Update NUMA nodes based on NumaConfig
Relying on the list of CPUs defined through the NumaConfig, this patch will update the internal list of CPUs attached to each NUMA node. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
@@ -66,12 +66,21 @@ struct HotPlugState {
|
||||
#[derive(Clone)]
|
||||
pub struct NumaNode {
|
||||
memory_regions: Vec<Arc<GuestRegionMmap>>,
|
||||
cpus: Vec<u8>,
|
||||
}
|
||||
|
||||
impl NumaNode {
|
||||
pub fn memory_regions(&self) -> &Vec<Arc<GuestRegionMmap>> {
|
||||
&self.memory_regions
|
||||
}
|
||||
|
||||
pub fn cpus(&self) -> &Vec<u8> {
|
||||
&self.cpus
|
||||
}
|
||||
|
||||
pub fn cpus_mut(&mut self) -> &mut Vec<u8> {
|
||||
&mut self.cpus
|
||||
}
|
||||
}
|
||||
|
||||
pub type NumaNodes = BTreeMap<u32, NumaNode>;
|
||||
@@ -356,6 +365,7 @@ impl MemoryManager {
|
||||
node_id,
|
||||
NumaNode {
|
||||
memory_regions: vec![region.clone()],
|
||||
cpus: Vec::new(),
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -1233,6 +1243,10 @@ impl MemoryManager {
|
||||
pub fn numa_nodes(&self) -> &NumaNodes {
|
||||
&self.numa_nodes
|
||||
}
|
||||
|
||||
pub fn numa_nodes_mut(&mut self) -> &mut NumaNodes {
|
||||
&mut self.numa_nodes
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "acpi")]
|
||||
|
||||
Reference in New Issue
Block a user