From 4a99b931f84a74bf65e09045705c07c1ab77da88 Mon Sep 17 00:00:00 2001 From: Vojtech Horky Date: Wed, 2 Aug 2017 16:20:42 +0200 Subject: [PATCH] test-in-vm.sh: add --memory for RAM size --- test-in-vm.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test-in-vm.sh b/test-in-vm.sh index 8519a68..683851f 100755 --- a/test-in-vm.sh +++ b/test-in-vm.sh @@ -222,7 +222,7 @@ xx_start_machine() { -redir tcp:8080::8080 -redir tcp:8081::8081 \ -redir tcp:2223::2223 \ -usb \ - -m 256 \ + -m "${XX_MEMORY_MB}" \ -daemonize -pidfile "$XX_TEMP/$name.pid" \ -monitor "unix:$XX_TEMP/$name.monitor,server,nowait" \ -boot d \ @@ -479,6 +479,7 @@ where [options] are: --image=FILE File with main HelenOS image (specify --arch). --arch=ARCH Architecture of the image file (see --image). --no-kvm Do not try to run QEMU with KVM enabled. +--memory=INT Size of VM RAM in INT MB. --fail-fast Exit with first error. --debug Print (a lot of) debugging messages. --activity Print messages about background activity. @@ -505,6 +506,7 @@ XX_HELENOS_ROOT="." XX_AUTODETECT_HELENOS=false XX_ARCH="" XX_CDROM_FILE="" +XX_MEMORY_MB="" XX_FAIL_FAST=false XX_KNOWN_MACHINES="" @@ -547,6 +549,12 @@ while [ $# -gt 0 ]; do XX_ARCH=`echo "$1" | cut '-d=' -f 2-` XX_AUTODETECT_HELENOS=false ;; + --memory=*) + XX_MEMORY_MB=`echo "$1" | cut '-d=' -f 2-` + if ! echo "$XX_MEMORY_MB" | grep -q '^[1-9][0-9]*$'; then + xx_fatal "--memory has to be provided as an integer." + fi + ;; --temp=*) XX_TEMP=`echo "$1" | cut '-d=' -f 2-` ;; @@ -570,6 +578,8 @@ while [ $# -gt 0 ]; do shift done +[ -z "$XX_MEMORY_MB" ] && XX_MEMORY_MB=256 + mkdir -p "$XX_TEMP" if $XX_AUTODETECT_HELENOS; then -- 2.11.4.GIT