diff --git a/vmm/src/api/openapi/cloud-hypervisor.yaml b/vmm/src/api/openapi/cloud-hypervisor.yaml index e2bc83d0d..ef4f34c11 100644 --- a/vmm/src/api/openapi/cloud-hypervisor.yaml +++ b/vmm/src/api/openapi/cloud-hypervisor.yaml @@ -468,7 +468,8 @@ components: type: boolean default: false host_numa_node: - type: uint64 + type: integer + format: uint32 MemoryConfig: required: diff --git a/vmm/src/config.rs b/vmm/src/config.rs index 7b3501783..540a0cdf8 100644 --- a/vmm/src/config.rs +++ b/vmm/src/config.rs @@ -353,7 +353,7 @@ pub struct MemoryZoneConfig { #[serde(default)] pub hugepages: bool, #[serde(default)] - pub host_numa_node: Option, + pub host_numa_node: Option, } #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] @@ -454,7 +454,7 @@ impl MemoryConfig { .unwrap_or(Toggle(false)) .0; let host_numa_node = parser - .convert::("host_numa_node") + .convert::("host_numa_node") .map_err(Error::ParseMemoryZone)?; zones.push(MemoryZoneConfig { diff --git a/vmm/src/memory_manager.rs b/vmm/src/memory_manager.rs index 001aa16cd..3c9309314 100644 --- a/vmm/src/memory_manager.rs +++ b/vmm/src/memory_manager.rs @@ -653,7 +653,7 @@ impl MemoryManager { prefault: bool, shared: bool, hugepages: bool, - host_numa_node: Option, + host_numa_node: Option, ext_regions: &Option>, ) -> Result, Error> { let mut backing_file: Option = file.clone(); @@ -778,7 +778,7 @@ impl MemoryManager { // 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 // 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. nodemask.resize((node as usize / 64) + 1, 0);