main, vmm: Add new --numa parameter

Through this new parameter, we give users the opportunity to specify a
set of CPUs attached to a NUMA node that has been previously created
from the --memory-zone parameter.

This parameter will be extended in the future to describe the distance
between multiple nodes.

For instance, if a user wants to attach CPUs 0, 1, 2 and 6 to a NUMA
node, here are two different ways of doing so:
Either
	./cloud-hypervisor ... --numa id=0,cpus=0-2:6
Or
	./cloud-hypervisor ... --numa id=0,cpus=0:1:2:6

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2020-08-28 18:20:12 +02:00
parent 36171caba9
commit 42f963d6f2
4 changed files with 120 additions and 1 deletions

View File

@@ -221,6 +221,14 @@ fn create_app<'a, 'b>(
.number_of_values(1)
.group("vm-config"),
)
.arg(
Arg::with_name("numa")
.long("numa")
.help(config::NumaConfig::SYNTAX)
.takes_value(true)
.min_values(1)
.group("vm-config"),
)
.arg(
Arg::with_name("v")
.short("v")
@@ -566,6 +574,7 @@ mod unit_tests {
iommu: false,
#[cfg(target_arch = "x86_64")]
sgx_epc: None,
numa: None,
};
aver_eq!(tb, expected_vm_config, result_vm_config);