summaryrefslogtreecommitdiffstats
path: root/remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc
diff options
context:
space:
mode:
Diffstat (limited to 'remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc')
-rw-r--r--remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc21
1 files changed, 7 insertions, 14 deletions
diff --git a/remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc b/remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc
index 9a46bc88..7ef03c1c 100644
--- a/remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc
+++ b/remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc
@@ -19,6 +19,7 @@ get_vm_id() {
fi
# fallback: take last two digits of current pid...
VM_ID=$(expr substr $$ $(expr ${#$} - 1) 2)
+ [ "${#VM_ID}" -eq 1 ] && VM_ID="0${VM_ID}"
}
get_vm_id
@@ -38,18 +39,18 @@ else
fi
# Calculate absulute amount of RAM that should stay available to the host
-reserve="$[ ( $totalmem * $reserve ) / 100 ]"
+reserve="$(( ( totalmem * reserve ) / 100 ))"
# Respect some upper and lower bounds for the host amount
[ "$reserve" -lt "$min" ] && reserve="$min"
[ "$reserve" -gt "$max" ] && reserve="$max"
# Get a result which can be divided by 4
-mem="$[ ( ( $totalmem - $reserve ) / 4 ) * 4 ]"
+mem="$(( ( ( totalmem - reserve ) / 4 ) * 4 ))"
if [ -n "$mainvirtmem" ]; then
- forcemem="$[ "$mainvirtmem" / 4 * 4 ]"
+ forcemem="$(( mainvirtmem / 4 * 4 ))"
mem="$forcemem"
fi
-hostmem="$[ $totalmem - $mem ]"
+hostmem="$(( totalmem - mem ))"
# Fill in VMID
macaddrsuffix=$(echo "$macaddrsuffix" | sed "s/%VMID%/${VM_ID}/")
@@ -75,17 +76,9 @@ cdrom0=${cdtest:-"FALSE"}
cdtest=${cdrom_1:+"TRUE"}
# if $cdtest not set cdrom1="FALSE", else "TRUE"
cdrom1=${cdtest:-"FALSE"}
-# IDE is expected default, test for the virtual disk image type should
-# be done while creating the runscripts ...
-# TODO enable SCSI support instead of just disabling it.
-ide="TRUE"
-scsi="FALSE"
-hddrv="ide"
-audio="true"
-remotedesktopport="590${VM_ID}"
-# Enable 3D
-enable3d=$(grep -i -o "<enable3d param=.*" "${xmlfile}" | awk -F '"' '{print $2}' | rv_clean_string)
+# RDP/VNC port (59001 - 59099)
+remotedesktopport="590${VM_ID}"
# Add rw share for home dir
homesharepath="${HOME}/PERSISTENT"