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
|
#!/usr/bin/env sh
|
||||||
# What processor architecture to use
|
# What processor architecture to use
|
||||||
arch=$QEMUSH_ARCH
|
[ -z "$QEMUSH_ARCH" ] && QEMUSH_ARCH=$(uname -m)
|
||||||
[ -z "$arch" ] && arch=$(uname -m)
|
|
||||||
|
|
||||||
# How many CPU cores to use
|
# How many CPU cores to use
|
||||||
nproc=$QEMUSH_NPROC
|
[ -z "$QEMUSH_NPROC" ] && QEMUSH_NPROC=$(($(nproc) / 2))
|
||||||
[ -z "$nproc" ] && nproc=$(($(nproc) / 2))
|
|
||||||
|
|
||||||
# How much RAM to use
|
# How much RAM to use
|
||||||
ram=$QEMUSH_RAM
|
[ -z "$QEMUSH_RAM" ] && QEMUSH_RAM=$(($(free | grep '^Mem:\s' | awk '{ print $NF }') / 2))K
|
||||||
[ -z "$ram" ] && ram=$(($(free | grep '^Mem:\s' | awk '{ print $NF }') / 2))K
|
|
||||||
|
|
||||||
# Set the arguments
|
# Set the arguments
|
||||||
set -- "qemu-system-${arch}" \
|
set -- "qemu-system-${QEMUSH_ARCH}" \
|
||||||
-enable-kvm \
|
-enable-kvm \
|
||||||
-M q35 \
|
-cpu host -smp "$QEMUSH_NPROC" \
|
||||||
-cpu host -smp "$nproc" \
|
-m "$QEMUSH_RAM" \
|
||||||
-m "$ram" \
|
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
# Start the machine
|
# Start the machine
|
||||||
|
|
Loading…
Reference in a new issue