summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/debvm-run30
1 files changed, 19 insertions, 11 deletions
diff --git a/bin/debvm-run b/bin/debvm-run
index 7847cba..35a3459 100755
--- a/bin/debvm-run
+++ b/bin/debvm-run
@@ -217,7 +217,18 @@ set -- \
-device "virtio-net-pci,netdev=net0" \
"$@"
+MACHINE=
MAX_SMP=
+
+case "$VMARCH" in
+ amd64)
+ MACHINE="type=q35"
+ ;;
+ arm|arm64|armel|armhf|riscv64)
+ MACHINE="type=virt"
+ ;;
+esac
+
if test "$ARCHITECTURE" = "$VMARCH"; then
QEMU=kvm
# While kvm will fall back gracefully, the following options can only
@@ -227,7 +238,7 @@ if test "$ARCHITECTURE" = "$VMARCH"; then
fi
case "$VMARCH" in
arm64)
- set -- -machine type=virt,gic-version=host "$@"
+ MACHINE="$MACHINE,gic-version=host"
;;
esac
else
@@ -238,11 +249,11 @@ else
;;
arm64)
QEMU=qemu-system-aarch64
- set -- -machine virt -cpu max "$@"
+ set -- -cpu max "$@"
;;
arm|armel|armhf)
QEMU=qemu-system-arm
- set -- -machine virt -cpu max "$@"
+ set -- -cpu max "$@"
;;
powerpc)
QEMU=qemu-system-ppc
@@ -261,19 +272,16 @@ else
mipsel)
MAX_SMP=1
;;
- riscv64)
- set -- -machine virt "$@"
- ;;
sparc64)
MAX_SMP=1
;;
esac
fi
-case "$VMARCH" in
- amd64)
- set -- -machine q35 "$@"
- ;;
-esac
+
+if test -n "$MACHINE"; then
+ set -- -machine "$MACHINE" "$@"
+fi
+
if test -z "$MAX_SMP" || test "$MAX_SMP" -gt 1; then
NPROC=$(nproc)
test -n "$MAX_SMP" && test "$NPROC" -gt "$MAX_SMP" && NPROC=$MAX_SMP