mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: store CPU affinity lists as slices
Each affinity host CPU list is copied from configuration. It is only iterated afterwards, so a boxed slice is enough. On-behalf-of: SAP philipp.schuster@sap.com Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
This commit is contained in:
committed by
Rob Bradford
parent
74392eccae
commit
29e2319247
@@ -30,7 +30,7 @@ pub(crate) trait ApplyLandlock {
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
|
||||
pub struct CpuAffinity {
|
||||
pub vcpu: u32,
|
||||
pub host_cpus: Vec<usize>,
|
||||
pub host_cpus: Box<[usize]>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
|
||||
@@ -76,7 +76,7 @@ pub struct CpusConfig {
|
||||
#[serde(default = "default_cpuconfig_max_phys_bits")]
|
||||
pub max_phys_bits: u8,
|
||||
#[serde(default)]
|
||||
pub affinity: Option<Vec<CpuAffinity>>,
|
||||
pub affinity: Option<Box<[CpuAffinity]>>,
|
||||
#[serde(default)]
|
||||
pub features: CpuFeatures,
|
||||
#[serde(default = "default_cpusconfig_nested")]
|
||||
|
||||
Reference in New Issue
Block a user