launchers/kvm : suppression variables inutiles
This commit is contained in:
parent
84722e404f
commit
428ceb7738
1 changed files with 6 additions and 10 deletions
|
@ -1,22 +1,18 @@
|
|||
#!/usr/bin/env sh
|
||||
# What processor architecture to use
|
||||
arch=$QEMUSH_ARCH
|
||||
[ -z "$arch" ] && arch=$(uname -m)
|
||||
[ -z "$QEMUSH_ARCH" ] && QEMUSH_ARCH=$(uname -m)
|
||||
|
||||
# How many CPU cores to use
|
||||
nproc=$QEMUSH_NPROC
|
||||
[ -z "$nproc" ] && nproc=$(($(nproc) / 2))
|
||||
[ -z "$QEMUSH_NPROC" ] && QEMUSH_NPROC=$(($(nproc) / 2))
|
||||
|
||||
# How much RAM to use
|
||||
ram=$QEMUSH_RAM
|
||||
[ -z "$ram" ] && ram=$(($(free | grep '^Mem:\s' | awk '{ print $NF }') / 2))K
|
||||
[ -z "$QEMUSH_RAM" ] && QEMUSH_RAM=$(($(free | grep '^Mem:\s' | awk '{ print $NF }') / 2))K
|
||||
|
||||
# Set the arguments
|
||||
set -- "qemu-system-${arch}" \
|
||||
set -- "qemu-system-${QEMUSH_ARCH}" \
|
||||
-enable-kvm \
|
||||
-M q35 \
|
||||
-cpu host -smp "$nproc" \
|
||||
-m "$ram" \
|
||||
-cpu host -smp "$QEMUSH_NPROC" \
|
||||
-m "$QEMUSH_RAM" \
|
||||
"$@"
|
||||
|
||||
# Start the machine
|
||||
|
|
Loading…
Reference in a new issue