From 4297af0ed0d9fd2cfa10cefc5b9b74e6f923a3a3 Mon Sep 17 00:00:00 2001 From: Jakub Kicinski Date: Sun, 3 Nov 2024 16:16:25 -0800 Subject: [PATCH] contest: vm: support setting memory size Add first class citizen setting for memory size, since we have one for CPU count. Like QEMU and vng the memory size is in MB. Signed-off-by: Jakub Kicinski --- contest/remote/lib/vm.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contest/remote/lib/vm.py b/contest/remote/lib/vm.py index a7e8a64..ed5ef4b 100644 --- a/contest/remote/lib/vm.py +++ b/contest/remote/lib/vm.py @@ -179,6 +179,9 @@ def start(self, cwd=None): cpus = self.config.get('vm', 'cpus', fallback="") if cpus: cmd += ["--cpus", cpus] + mem = self.config.get('vm', 'mem', fallback="") + if mem: + cmd += ["--memory", mem] print(f"INFO{self.print_pfx} VM starting:", " ".join(cmd)) self.log_out += "# " + " ".join(cmd) + "\n"