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