summaryrefslogtreecommitdiff
path: root/debvm-run
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2022-12-23 08:16:54 +0100
committerHelmut Grohne <helmut@subdivi.de>2022-12-23 08:16:54 +0100
commitf3caaf885cf4b4f1e7489d1019f76ed517037ebe (patch)
treeb05f79bfc1eef004bc118be804d4768d7050121d /debvm-run
parentaadbcc92761cf3bbc730ccf39aa5e09d22f343db (diff)
downloaddebvm-f3caaf885cf4b4f1e7489d1019f76ed517037ebe.tar.gz
debvm-run: reenable smp for ppc64el
Fixes: aadbcc92761c ("Support mips* (Closes: #1)")
Diffstat (limited to 'debvm-run')
-rwxr-xr-xdebvm-run13
1 files changed, 10 insertions, 3 deletions
diff --git a/debvm-run b/debvm-run
index 96058d5..419c6ca 100755
--- a/debvm-run
+++ b/debvm-run
@@ -100,6 +100,7 @@ set -- \
-device "virtio-net-pci,netdev=net0" \
"$@"
+MAX_SMP=
if test "$ARCHITECTURE" = "$VMARCH"; then
QEMU=kvm
# While kvm will fall back gracefully, the following options can only
@@ -116,28 +117,34 @@ else
case "$VMARCH" in
arm64)
QEMU=qemu-system-aarch64
- set -- -machine virt -cpu max -smp "$(nproc)" "$@"
+ set -- -machine virt -cpu max "$@"
;;
arm|armel|armhf)
QEMU=qemu-system-arm
- set -- -machine virt -cpu max -smp "$(nproc)" "$@"
+ set -- -machine virt -cpu max "$@"
;;
ppc64el)
QEMU=qemu-system-ppc64
;;
mips64el)
QEMU="qemu-system-$VMARCH"
+ MAX_SMP=1
set -- -cpu 5KEc "$@"
;;
mipsel)
QEMU="qemu-system-$VMARCH"
+ MAX_SMP=1
;;
*)
QEMU="qemu-system-$VMARCH"
- set -- -smp "$(nproc)" "$@"
;;
esac
fi
+if test "$MAX_SMP" -gt 1; then
+ NPROC=$(nproc)
+ test "$NPROC" -gt "$MAX_SMP" && NPROC=$MAX_SMP
+ set -- -smp "$NPROC" "$@"
+fi
if test -z "$GRAPHICAL"; then
set -- -nographic "$@"