diff options
author | Helmut Grohne <helmut@subdivi.de> | 2023-01-21 08:06:41 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2023-01-21 08:06:41 +0100 |
commit | 668a08f4950417a59270e56176402cfd0acd858e (patch) | |
tree | 1b4eba9ae83e8b0a8c8b12b3d8ab26c0c44ea178 | |
parent | a69b9eb9ae65f516cb7b5b99448e0124da88de89 (diff) | |
download | debvm-668a08f4950417a59270e56176402cfd0acd858e.tar.gz |
debvm-run: also pass reasonable -cpu for native non-kvm
-rwxr-xr-x | bin/debvm-run | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/bin/debvm-run b/bin/debvm-run index 5884551..891cf21 100755 --- a/bin/debvm-run +++ b/bin/debvm-run @@ -218,6 +218,7 @@ set -- \ "$@" QEMU="qemu-system-$VMARCH" +CPU= MACHINE= MAX_SMP= @@ -227,12 +228,17 @@ case "$VMARCH" in MACHINE="type=q35" ;; arm|armel|armhf) + CPU=max MACHINE="type=virt" ;; arm64) QEMU=qemu-system-aarch64 + CPU=max MACHINE="type=virt" ;; + mips64el) + CPU=5KEc + ;; powerpc) QEMU=qemu-system-ppc ;; @@ -253,33 +259,25 @@ if test "$ARCHITECTURE" = "$VMARCH"; then # While kvm will fall back gracefully, the following options can only # be passed when kvm really is available. if test -w /dev/kvm; then - set -- -cpu host "$@" + CPU=host if test "$VMARCH" = arm64; then MACHINE="$MACHINE,gic-version=host" fi fi else case "$VMARCH" in - arm64) - set -- -cpu max "$@" - ;; - arm|armel|armhf) - set -- -cpu max "$@" - ;; - m68k|mipsel|powerpc|sparc64) + m68k|mips64el|mipsel|powerpc|sparc64) MAX_SMP=1 ;; - mips64el) - MAX_SMP=1 - set -- -cpu 5KEc "$@" - ;; esac fi if test -n "$MACHINE"; then set -- -machine "$MACHINE" "$@" fi - +if test -n "$CPU"; then + set -- -cpu "$CPU" "$@" +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 |