[scripts] Allow --smp option in qemu.sh

Allow changing the default number of CPUs when running QEMU via script
command line.
This commit is contained in:
Justin C. Miller
2021-04-07 22:58:25 -07:00
parent e408142ca5
commit ec58d1c309

29
qemu.sh
View File

@@ -11,30 +11,43 @@ kvm=""
cpu="Broadwell,+pdpe1gb" cpu="Broadwell,+pdpe1gb"
smp=4 smp=4
for arg in $@; do while true; do
case "${arg}" in case "$1" in
--debugboot) -b | --debugboot)
debug="-s -S" debug="-s -S"
debugtarget="${build}/boot/boot.efi" debugtarget="${build}/boot/boot.efi"
flash_name="ovmf_vars_d" flash_name="ovmf_vars_d"
shift
;; ;;
--debug) -d | --debug)
debug="-s -S" debug="-s -S"
flash_name="ovmf_vars_d" flash_name="ovmf_vars_d"
shift
;; ;;
--gfx) -g | --gfx)
gfx="" gfx=""
vga="" vga=""
shift
;; ;;
--vga) -v | --vga)
vga="" vga=""
shift
;; ;;
--kvm) -k | --kvm)
kvm="-enable-kvm" kvm="-enable-kvm"
cpu="host" cpu="host"
shift
;;
-c | --cpus)
smp=$2
shift 2
;; ;;
*) *)
build="${arg}" if [ -d "$1" ]; then
build="$1"
shift
fi
break
;; ;;
esac esac
done done