diff options
author | Michael Janczyk | 2009-02-27 18:49:33 +0100 |
---|---|---|
committer | Michael Janczyk | 2009-02-27 18:49:33 +0100 |
commit | d0ac64c3499a022537fb3e6e03be2fe9b1d78222 (patch) | |
tree | 434332442ad09171d91a7b7afd60fb48331b0726 /os-plugins/plugins/vmware/files/run-virt.include | |
parent | Cleaning up after rewriting of vmware/player starting scripts ... (diff) | |
download | core-d0ac64c3499a022537fb3e6e03be2fe9b1d78222.tar.gz core-d0ac64c3499a022537fb3e6e03be2fe9b1d78222.tar.xz core-d0ac64c3499a022537fb3e6e03be2fe9b1d78222.zip |
changed memory-check for vmware:
- standard 30%
- if 1,6+g 40%
- if id44 60%
- if id44 && if 2,5+g 40% needed because vmpl2+ writes a lot on disk, which costs a lot of time :( (further research needed)
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2657 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/plugins/vmware/files/run-virt.include')
-rw-r--r-- | os-plugins/plugins/vmware/files/run-virt.include | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/os-plugins/plugins/vmware/files/run-virt.include b/os-plugins/plugins/vmware/files/run-virt.include index cb1d23b9..d3ecf6c1 100644 --- a/os-plugins/plugins/vmware/files/run-virt.include +++ b/os-plugins/plugins/vmware/files/run-virt.include @@ -191,9 +191,6 @@ conffile="${confdir}/run-vmware.conf" # users vmware config folder vmhome="${HOME}/.vmware" -# percentage of memory to use for vmwares in standard case -permem=60 - # serial port defined (e.g. "ttyS0" or "autodetect") serial=$(grep -i "<serial port=\"" ${xml} | awk -F "\"" '{ print $2 }') case "$serial" in @@ -211,26 +208,37 @@ case "$serial" in ;; esac -# Hack, if more than 2,5G RAM use 40% of Ram and write vmem into Ram as well -# (40% vmware | 40% confdir(vmem...) | 20% host -if [ "${totalmem}" -ge "2500" ]; then +# percentage of memory to use for vmwares in standard case +permem=30 +if [ "${totalmem}" -ge "1600" ]; then permem=40 - confdir=/dev/shm/vmware/$USER - conffile=${confdir}/run-vmware.conf - mkdir -p /dev/shm/vmware/$USER -# if there is no scratch space on disk you have to waste your mem -elif grep -qe "ramfs /tmp " /proc/mounts ; then - permem=30 +fi +# check if /tmp is on harddisk +if grep -qe "/dev/.* /tmp " /proc/mounts ; then + permem=60 + id44="1" + # Hack, if more than 2,5G RAM use 40% of Ram and write vmem into Ram as well + # (40% vmware | 40% confdir(vmem...) | 20% host + # VMplayer 2+ issue + if [ "${totalmem}" -ge "2500" ]; then + permem=40 + confdir=/dev/shm/vmware/$USER + conffile=${confdir}/run-vmware.conf + mkdir -p /dev/shm/vmware/$USER + fi fi mem=$(expr ${totalmem} / 100 \* ${permem} / 4 \* 4) +if [ "${id44}" = "1" ]; then + memhost=$(expr ${totalmem} - ${mem}) +else + memhost=$(expr ${totalmem} - ${mem} - ${mem}) +fi # check memory range -memtest=${totalmem}-128 -if [ "${mem}" -lt "128" ] || [ "${mem}" -gt "${totalmem}" ]; then +if [ "${mem}" -lt "256" ] || [ "${memhost}" -lt "256" ]; then writelog "\n\n" writelog "\tYour memory is out of range: ${mem} MB." - writelog "\tMin. 128 MB for host and guest!" - writelog "tTry --mem option." + writelog "\tMin. 256 MB for host and guest!" exit 1 fi @@ -326,6 +334,7 @@ writelog "\t/tmp info: \ writelog "Hardware:" writelog "\tMAC:\t\t00:50:56:0D:${mac}" writelog "\tMem:\t\t${mem} MB" +writelog "\tHostmem:\t${memhost} MB" writelog "\tMax. res.:\t${xres}x${yres}" writelog "\tCD-ROM_1:\t${cdr_1}" writelog "\tCD-ROM_2:\t${cdr_2}" |