main, vmm: Let the user define distincts memory zones

Introducing a new CLI option --memory-zone letting the user specify
custom memory zones. When this option is present, the --memory size
must be explicitly set to 0.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2020-08-18 15:19:49 +02:00
committed by Samuel Ortiz
parent d25ec66bb6
commit be475ddc22
3 changed files with 123 additions and 11 deletions

View File

@@ -114,6 +114,18 @@ fn create_app<'a, 'b>(
.default_value(&default_memory)
.group("vm-config"),
)
.arg(
Arg::with_name("memory-zone")
.long("memory-zone")
.help(
"User defined memory zone parameters \
\"size=<guest_memory_region_size>,file=<backing_file>,\
mergeable=on|off,shared=on|off,hugepages=on|off\"",
)
.takes_value(true)
.min_values(1)
.group("vm-config"),
)
.arg(
Arg::with_name("kernel")
.long("kernel")
@@ -522,6 +534,7 @@ mod unit_tests {
hugepages: false,
balloon: false,
balloon_size: 0,
zones: None,
},
kernel: Some(KernelConfig {
path: PathBuf::from("/path/to/kernel"),