0
0

control-vm.sh: Simplify setting of CPUs

This commit is contained in:
Nils Freydank 2024-05-05 18:28:45 +02:00
parent 98d03dda6a
commit 73675c697c
Signed by: nfr
GPG Key ID: 0F1DEAB2D36AD112

View File

@ -48,8 +48,8 @@
# cat << _EOF > "${GUEST_NAME}/virtual-machine.bash"
# # Provide the GUEST_NAME which is used in further configuration.
# GUEST_NAME="Guest-OS"
# # Configure the number of CPUs.
# CPUS="2"
# # Configure the number of CPUs. Simplified and based on
# # `qemu-system-<arch> -smp help`.
# CPU_CORES="8"
# MEMORY="16384"
# NET="True"
@ -70,8 +70,7 @@
# === Define default values ===
CLIPBOARD="${CLIPBOARD:-}"
CPUS="${CPUS:-16}"
CPU_CORES="${CPU_CORES:-1}"
CPU_CORES="${CPU_CORES:-8}"
EFI="${EFI:-True}"
GUEST_NAME="${1}"
LIVE_ONLY="${LIVE_ONLY:-}"
@ -115,7 +114,7 @@ QEMU_COMMON_ARGS=(
# Use the same CPU as the host has for maximum performoance and configure
# the amount of memory and CPU cores as configured per-host.
-cpu host
-smp cpus="${CPUS}",maxcpus="${CPUS}",cores="${CPU_CORES}"
-smp cores="${CPU_CORES}"
-m "${MEMORY}"
# Detach from the current shell and monitor by pid file and a unix socket.
-daemonize