qemu_template: use more cpus for ARM if available

But don't hog all `VM_NCPUS`, as we are still emulating them

Signed-off-by: Vincent Batts <vbatts@kinvolk.io>
This commit is contained in:
Vincent Batts 2020-09-15 17:39:35 -04:00
parent a22f316c23
commit a97df50696
No known key found for this signature in database
GPG Key ID: 524F155275DF0C3E

View File

@ -158,7 +158,12 @@ else
arm64-usr+aarch64)
set -- -machine virt,accel=kvm,gic-version=3 -cpu host -smp "${VM_NCPUS}" -nographic "$@" ;;
arm64-usr+*)
set -- -machine virt -cpu cortex-a57 -smp 1 -nographic "$@" ;;
if test "${VM_NCPUS}" -gt 4 ; then
VM_NCPUS=4
elif test "${VM_NCPUS}" -gt 2 ; then
VM_NCPUS=2
fi
set -- -machine virt -cpu cortex-a57 -smp "${VM_NCPUS}" -nographic "$@" ;;
*)
die "Unsupported arch" ;;
esac