From e530a41bf4ef1b84917cd1295d5aaf30051e42c9 Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Fri, 9 Apr 2010 22:07:25 +0200 Subject: qemukvm network configuration --- os-plugins/plugins/vmgrid/files/run-vmgrid.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'os-plugins/plugins/vmgrid/files/run-vmgrid.sh') diff --git a/os-plugins/plugins/vmgrid/files/run-vmgrid.sh b/os-plugins/plugins/vmgrid/files/run-vmgrid.sh index bf10dc36..5e64b4cd 100644 --- a/os-plugins/plugins/vmgrid/files/run-vmgrid.sh +++ b/os-plugins/plugins/vmgrid/files/run-vmgrid.sh @@ -39,11 +39,12 @@ RWSHARE=/var/opt/openslx/plugins/vmgrid/share ################################################################################ # function to write to stdout and logfile +LOGFILE=${OPENSLX_DEFAULT_LOGDIR}/run-vmgrid.${USER}.$$.log writelog () { # write to stdout echo -e "$1" # log into file - echo -e "$1" >> ${OPENSLX_DEFAULT_LOGDIR}/run-vmgrid.${USER}.$$.log + echo -e "$1" >> ${LOGFILE} # log into share dir, so that log is available in vm as well echo -e "$1" >> ${vmgrid_rwmnt}/logs/run-vmgrid.${USER}.$$.log } @@ -66,7 +67,8 @@ while [ $# -gt 0 ]; do ;; --forcemem) # get a result which can be divided through 4 - forcemem=$(expr $2 / 4 \* 4) + forcemem=$2 + echo $2 | grep -q '[1-9][0-9]\{2,3\}$' && forcemem=$(expr $2 / 4 \* 4) shift ;; *) @@ -113,7 +115,7 @@ if [ "${vmgrid_virt}" = "xen" ]; then runningvms=$(expr ${runningvms} + 1) fi # check value -if [ $runningvms -le 0 ]; then +if [ ${runningvms} -le 0 ]; then writelog "Error in value: Running VMs: ${runningvms}. Exit!" exit 1 fi @@ -288,9 +290,9 @@ vmostype=$(grep -io '/dev/null 2>&1 +fi + # remove config dirs when finished if echo "${RMDIRS}" 2>/dev/null | grep -q ${vmgrid_virt}; then writelog "${vmgrid_virt} exited. Cleanning up... \c" -- cgit v1.2.3-55-g7522