From ec58d1c309bb43f4707ce0043086fdf15fb26436 Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Wed, 7 Apr 2021 22:58:25 -0700 Subject: [PATCH] [scripts] Allow --smp option in qemu.sh Allow changing the default number of CPUs when running QEMU via script command line. --- qemu.sh | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/qemu.sh b/qemu.sh index 85acfaa..96e26db 100755 --- a/qemu.sh +++ b/qemu.sh @@ -11,30 +11,43 @@ kvm="" cpu="Broadwell,+pdpe1gb" smp=4 -for arg in $@; do - case "${arg}" in - --debugboot) +while true; do + case "$1" in + -b | --debugboot) debug="-s -S" debugtarget="${build}/boot/boot.efi" flash_name="ovmf_vars_d" + shift ;; - --debug) + -d | --debug) debug="-s -S" flash_name="ovmf_vars_d" + shift ;; - --gfx) + -g | --gfx) gfx="" vga="" + shift ;; - --vga) + -v | --vga) vga="" + shift ;; - --kvm) + -k | --kvm) kvm="-enable-kvm" cpu="host" + shift ;; + -c | --cpus) + smp=$2 + shift 2 + ;; *) - build="${arg}" + if [ -d "$1" ]; then + build="$1" + shift + fi + break ;; esac done