mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-07-05 01:12:36 +00:00
vmm: Use u32 instead of u64 for host_numa_node option
Given that ACPI uses u32 as the type for the Proximity Domain, we can use u32 instead of u64 as the type for 'host_numa_node' option. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
4c6a250383
commit
274c001eab
@ -468,7 +468,8 @@ components:
|
|||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
host_numa_node:
|
host_numa_node:
|
||||||
type: uint64
|
type: integer
|
||||||
|
format: uint32
|
||||||
|
|
||||||
MemoryConfig:
|
MemoryConfig:
|
||||||
required:
|
required:
|
||||||
|
@ -353,7 +353,7 @@ pub struct MemoryZoneConfig {
|
|||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub hugepages: bool,
|
pub hugepages: bool,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub host_numa_node: Option<u64>,
|
pub host_numa_node: Option<u32>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
|
||||||
@ -454,7 +454,7 @@ impl MemoryConfig {
|
|||||||
.unwrap_or(Toggle(false))
|
.unwrap_or(Toggle(false))
|
||||||
.0;
|
.0;
|
||||||
let host_numa_node = parser
|
let host_numa_node = parser
|
||||||
.convert::<u64>("host_numa_node")
|
.convert::<u32>("host_numa_node")
|
||||||
.map_err(Error::ParseMemoryZone)?;
|
.map_err(Error::ParseMemoryZone)?;
|
||||||
|
|
||||||
zones.push(MemoryZoneConfig {
|
zones.push(MemoryZoneConfig {
|
||||||
|
@ -653,7 +653,7 @@ impl MemoryManager {
|
|||||||
prefault: bool,
|
prefault: bool,
|
||||||
shared: bool,
|
shared: bool,
|
||||||
hugepages: bool,
|
hugepages: bool,
|
||||||
host_numa_node: Option<u64>,
|
host_numa_node: Option<u32>,
|
||||||
ext_regions: &Option<Vec<MemoryRegion>>,
|
ext_regions: &Option<Vec<MemoryRegion>>,
|
||||||
) -> Result<Arc<GuestRegionMmap>, Error> {
|
) -> Result<Arc<GuestRegionMmap>, Error> {
|
||||||
let mut backing_file: Option<PathBuf> = file.clone();
|
let mut backing_file: Option<PathBuf> = file.clone();
|
||||||
@ -778,7 +778,7 @@ impl MemoryManager {
|
|||||||
// Linux is kind of buggy in the way it interprets maxnode as it
|
// Linux is kind of buggy in the way it interprets maxnode as it
|
||||||
// will cut off the last node. That's why we have to add 1 to what
|
// will cut off the last node. That's why we have to add 1 to what
|
||||||
// we would consider as the proper maxnode value.
|
// we would consider as the proper maxnode value.
|
||||||
let maxnode = node + 1 + 1;
|
let maxnode = node as u64 + 1 + 1;
|
||||||
|
|
||||||
// Allocate the right size for the vector.
|
// Allocate the right size for the vector.
|
||||||
nodemask.resize((node as usize / 64) + 1, 0);
|
nodemask.resize((node as usize / 64) + 1, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user