Arguments

Arguments
This commit is contained in:
Kroese 2023-04-21 11:03:51 +02:00 committed by GitHub
commit 0f0b028cf1

View File

@ -60,17 +60,15 @@ RAM_OPTS=$(echo "-m ${RAM_SIZE}" | sed 's/MB/M/g;s/GB/G/g;s/TB/T/g')
CPU_OPTS="-smp ${CPU_CORES},sockets=1,cores=${CPU_CORES},threads=1" CPU_OPTS="-smp ${CPU_CORES},sockets=1,cores=${CPU_CORES},threads=1"
EXTRA_OPTS="-device virtio-balloon-pci,id=balloon0 -object rng-random,id=rng0,filename=/dev/urandom -device virtio-rng-pci,rng=rng0" EXTRA_OPTS="-device virtio-balloon-pci,id=balloon0 -object rng-random,id=rng0,filename=/dev/urandom -device virtio-rng-pci,rng=rng0"
ARGS="${DEF_OPTS} ${CPU_OPTS} ${RAM_OPTS} ${KVM_OPTS} ${MON_OPTS} ${SERIAL_OPTS} ${NET_OPTS} ${DISK_OPTS} ${EXTRA_OPTS}" ARGS="${DEF_OPTS} ${CPU_OPTS} ${RAM_OPTS} ${KVM_OPTS} ${MON_OPTS} ${SERIAL_OPTS} ${NET_OPTS} ${DISK_OPTS} ${EXTRA_OPTS}"
ARGS=("${ARGS//$'\t'/}")
SPLIT=$(echo -e "${ARGS// -/\\n-}") for a in "${ARGS[@]}"; do
readarray -t ARG <<<"$SPLIT"
for a in "${ARG[@]}"; do
echo "> '$a'" echo "> '$a'"
done done
set -m set -m
( (
qemu-system-x86_64 "${ARG[@]}" & echo $! > "${_QEMU_PID}" qemu-system-x86_64 "${ARGS[@]}" & echo $! > "${_QEMU_PID}"
) )
set +m set +m