[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"
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