From 78fdd1c4a0d2c6a7314f997340b588c9eccc2b48 Mon Sep 17 00:00:00 2001 From: Ahurac Date: Tue, 12 Mar 2024 10:49:09 +0100 Subject: [PATCH] launchers/kvm : type de machine optionel --- qemu/launchers/kvm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qemu/launchers/kvm b/qemu/launchers/kvm index 3f3a84c..45e90be 100755 --- a/qemu/launchers/kvm +++ b/qemu/launchers/kvm @@ -2,12 +2,22 @@ # What processor architecture to use [ -z "$QEMUSH_ARCH" ] && QEMUSH_ARCH=$(uname -m) +# What machine type to use +[ -z "$QEMUSH_MACHINE" ] && case "$QEMUSH_ARCH" in + x86_64) + QEMUSH_MACHINE=q35 + ;; +esac + # How many CPU cores to use [ -z "$QEMUSH_NPROC" ] && QEMUSH_NPROC=$(($(nproc) / 2)) # How much RAM to use [ -z "$QEMUSH_RAM" ] && QEMUSH_RAM=$(($(free | grep '^Mem:\s' | awk '{ print $NF }') / 2))K +# Use selected QEMUSH_MACHINE type if set +[ -n "$QEMUSH_MACHINE" ] && set -- -M "$QEMUSH_MACHINE" "$@" + # Set the arguments set -- "qemu-system-${QEMUSH_ARCH}" \ -enable-kvm \