cli: Accept K,M,G suffixes for size parameters

For every parameter dealing with a size as option, such as memory or
virtio-pmem, the CLI can now parse sizes with the suffixes K, M or G.

Fixes #70

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2019-07-08 20:13:02 -07:00
committed by Rob Bradford
parent 2bb0b22cc1
commit a2947f9a9f
3 changed files with 34 additions and 20 deletions
+1 -1
View File
@@ -924,7 +924,7 @@ impl<'a> Vm<'a> {
let fd = Arc::new(fd);
// Init guest memory
let arch_mem_regions = arch::arch_memory_regions(config.memory.size << 20);
let arch_mem_regions = arch::arch_memory_regions(config.memory.size);
let guest_memory = match config.memory.file {
Some(file) => {