summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/debvm-run43
1 files changed, 21 insertions, 22 deletions
diff --git a/bin/debvm-run b/bin/debvm-run
index 6984528..5884551 100755
--- a/bin/debvm-run
+++ b/bin/debvm-run
@@ -217,20 +217,38 @@ set -- \
-device "virtio-net-pci,netdev=net0" \
"$@"
+QEMU="qemu-system-$VMARCH"
MACHINE=
MAX_SMP=
case "$VMARCH" in
amd64)
+ QEMU=qemu-system-x86_64
MACHINE="type=q35"
;;
- arm|arm64|armel|armhf|riscv64)
+ arm|armel|armhf)
+ MACHINE="type=virt"
+ ;;
+ arm64)
+ QEMU=qemu-system-aarch64
+ MACHINE="type=virt"
+ ;;
+ powerpc)
+ QEMU=qemu-system-ppc
+ ;;
+ ppc64el)
+ QEMU=qemu-system-ppc64
+ ;;
+ riscv64)
MACHINE="type=virt"
;;
esac
if test "$ARCHITECTURE" = "$VMARCH"; then
- QEMU=kvm
+ if ! command -v "$QEMU" >/dev/null 2>&1; then
+ # Fall back to kvm in case we badly guessed qemu.
+ QEMU=kvm
+ fi
MACHINE="${MACHINE:+$MACHINE,}accel=kvm:tcg"
# While kvm will fall back gracefully, the following options can only
# be passed when kvm really is available.
@@ -241,39 +259,20 @@ if test "$ARCHITECTURE" = "$VMARCH"; then
fi
fi
else
- QEMU="qemu-system-$VMARCH"
case "$VMARCH" in
- amd64)
- QEMU=qemu-system-x86_64
- ;;
arm64)
- QEMU=qemu-system-aarch64
set -- -cpu max "$@"
;;
arm|armel|armhf)
- QEMU=qemu-system-arm
set -- -cpu max "$@"
;;
- powerpc)
- QEMU=qemu-system-ppc
- MAX_SMP=1
- ;;
- ppc64el)
- QEMU=qemu-system-ppc64
- ;;
- m68k)
+ m68k|mipsel|powerpc|sparc64)
MAX_SMP=1
;;
mips64el)
MAX_SMP=1
set -- -cpu 5KEc "$@"
;;
- mipsel)
- MAX_SMP=1
- ;;
- sparc64)
- MAX_SMP=1
- ;;
esac
fi