summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/vmchooser/files/run-virt.sh
diff options
context:
space:
mode:
authorDirk von Suchodoletz2009-03-06 17:41:32 +0100
committerDirk von Suchodoletz2009-03-06 17:41:32 +0100
commit39c9919fc3025d1a55e2342f47b11b460e9fc702 (patch)
tree764c5324e474890b7dd80c58d0cb27882ace7e02 /os-plugins/plugins/vmchooser/files/run-virt.sh
parentworking at #393: (diff)
downloadcore-39c9919fc3025d1a55e2342f47b11b460e9fc702.tar.gz
core-39c9919fc3025d1a55e2342f47b11b460e9fc702.tar.xz
core-39c9919fc3025d1a55e2342f47b11b460e9fc702.zip
Fix in run-virt.sh - the config.xml generation issue is still to be
solved. git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2694 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/plugins/vmchooser/files/run-virt.sh')
-rw-r--r--os-plugins/plugins/vmchooser/files/run-virt.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/os-plugins/plugins/vmchooser/files/run-virt.sh b/os-plugins/plugins/vmchooser/files/run-virt.sh
index c699cc2a..5c14e591 100644
--- a/os-plugins/plugins/vmchooser/files/run-virt.sh
+++ b/os-plugins/plugins/vmchooser/files/run-virt.sh
@@ -34,7 +34,13 @@ xml=$1
# File name of the image
imagename=$(grep -io "<image_name param=.*\"" ${xml} | awk -F "\"" '{ print $2 }')
-diskfile=$imagename
+
+# Path to the image (readlink produces the absolute path if called relatively)
+# imgpath=$(grep -io "<path_to param=.*\"" ${xml} | awk -F "\"" '{ print $2 }')
+[ -z $imgpath ] && { imgpath=$(readlink -f $xml); imgpath=${imgpath%/*.xml}; }
+
+# Diskfile is file including absolute path to it
+diskfile=$imgpath/$imagename
[ -e $diskfile ] || { echo -e "\n\tImage file $diskfile not found!"; exit 1; }
# Short description of the image (as present in the vmchooser menu line)
@@ -89,8 +95,6 @@ totalmem=$(expr $(grep -i "memtotal" /proc/meminfo | awk '{print $2}') / 1024)
mac=$(/sbin/ifconfig eth0 | grep eth0 | sed -e "s/ //g" \
| awk -F ":" '{print $(NF-1)":"$NF}')
-echo "$totalmem, $mac"
-
# Virtual fd/cd/dvd and drive devices, floppy b: for configuration file (xml)
floppya="FALSE"
floppyb="TRUE"
@@ -203,6 +207,8 @@ writelog "finished\n"
# Copy guest configuration (with added information) config.xml to be accessed
# via virtual floppy
+# fixme -> to be changed (vmchooser adapts the file content!?)
+echo "Please fix the config.xml generation"
cp ${xml} /var/lib/virt/vmchooser/fd-loop/config.xml
# Check if virtual machine container file exists