Vars refactor: Replace ram with RAM_VM

This commit is contained in:
Martin Wimpress 2020-03-21 10:49:42 +00:00
parent 1399d62a69
commit 7682463e27
No known key found for this signature in database
GPG Key ID: 61DF940515E06DA3

View File

@ -199,14 +199,14 @@ function vm_boot() {
fi
echo " - CPU: ${CORES_VM} Core(s)"
local ram="2G"
local RAM_VM="2G"
local RAM_HOST=$(free --mega -h | grep Mem | cut -d':' -f2 | cut -d'G' -f1 | sed 's/ //g')
if [ ${RAM_HOST} -ge 64 ]; then
ram="4G"
RAM_VM="4G"
elif [ ${RAM_HOST} -ge 16 ]; then
ram="3G"
RAM_VM="3G"
fi
echo " - RAM: ${ram}"
echo " - RAM: ${RAM_VM}"
local xres=1152
local yres=648
@ -278,7 +278,7 @@ function vm_boot() {
-machine q35,accel=kvm \
-cpu host,kvm=on \
-smp ${CORES_VM} \
-m ${ram} \
-m ${RAM_VM} \
-device virtio-balloon \
-netdev ${NET},id=nic \
-device virtio-net,netdev=nic \