summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthaibault2013-07-02 14:49:40 +0200
committertorben2013-07-02 14:49:40 +0200
commit4f701fca56a6d0a826b2cc44b23472f2eecd6911 (patch)
treedbc59eb91c83cb7f369ec9e3d3656146f333139a
parentPatched code to support persistent virtual machines for specified users. (diff)
downloadtm-scripts-4f701fca56a6d0a826b2cc44b23472f2eecd6911.tar.gz
tm-scripts-4f701fca56a6d0a826b2cc44b23472f2eecd6911.tar.xz
tm-scripts-4f701fca56a6d0a826b2cc44b23472f2eecd6911.zip
Sync files with patched branch.
-rw-r--r--[-rwxr-xr-x]remote/modules/vmchooser/data/opt/openslx/bin/clc.bash0
-rw-r--r--[-rwxr-xr-x]remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh14
-rw-r--r--[-rwxr-xr-x]remote/modules/vmchooser/data/opt/openslx/bin/xmlfilter.sh0
3 files changed, 6 insertions, 8 deletions
diff --git a/remote/modules/vmchooser/data/opt/openslx/bin/clc.bash b/remote/modules/vmchooser/data/opt/openslx/bin/clc.bash
index f5c989f4..f5c989f4 100755..100644
--- a/remote/modules/vmchooser/data/opt/openslx/bin/clc.bash
+++ b/remote/modules/vmchooser/data/opt/openslx/bin/clc.bash
diff --git a/remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh b/remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh
index 48c63789..826bfecd 100755..100644
--- a/remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh
+++ b/remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh
@@ -117,7 +117,7 @@ if [[ "$(grep --extended-regexp '< *persistent *param=".+"' "$1")" ]]; then
imageFilePath=$(grep -io '<image_name param=.*"' "$1" \
| sed -e "s/&.*;/; /g" | awk -F '"' '{ print $2 }')
diskmode='persistent' && \
- # TODO(torben) path shouldn't be hardcoded.
+ # TODO path shouldn't be hardcoded.
xmlfile="/var/lib/virt/vmware/$(sed 's/-persistent$//g' <<< "$(sed 's/vmdk$/xml/g' <<< "$(basename "$imageFilePath")")")" && \
# NOTE: We have to make sure that this folder is present to prevent
# getting an empty string by "readlink".
@@ -125,7 +125,7 @@ if [[ "$(grep --extended-regexp '< *persistent *param=".+"' "$1")" ]]; then
userBranchFilePath="$(readlink --canonicalize ~/.persistentVirtualMachines/$(basename "$imageFilePath"))"
# Create linked clone if not exists.
if [ ! -f "$userBranchFilePath" ]; then
- # TODO(torben) path shouldn't be hardcoded.
+ # TODO path shouldn't be hardcoded.
/opt/openslx/plugin-repo/vmchooser/clc.bash "$xmlfile" \
"$userBranchFilePath" --debug --verbose
fi
@@ -137,7 +137,7 @@ if ls ${xmlfile} 2>/dev/null | grep '/' >/dev/null 2>&1; then
xmlpath=$(dirname ${xmlfile})
xmlfile=$(basename ${xmlfile})
else
- xmlpath=${path}
+ xmlpath=${vmchooser_xmlpath}
fi
# full path
xmlfile="${xmlpath}/${xmlfile%.xml}.xml"
@@ -191,11 +191,10 @@ writelog "VM config:"
# Name of the virt image
imgname=$(grep -io '<image_name param=.*"' ${xmlfile} \
| sed -e "s/&.*;/; /g" | awk -F '"' '{ print $2 }')
-# TODO(torben) check if this code is necessary in future.
## Added for persistent support.
-#if [[ "$userBranchFilePath" ]]; then
-# imgname="$userBranchFilePath"
-#fi
+if [[ "$userBranchFilePath" ]]; then
+ imgname="$userBranchFilePath"
+fi
##
# Imagename /w full path
@@ -208,7 +207,6 @@ if echo ${imgname} 2>/dev/null | grep -q '^/' >/dev/null 2>&1; then
elif echo ${xmlfile} 2>/dev/null | grep -q '^/tmp/' >/dev/null 2>&1; then
vmpath=$imgname
imgname=$(basename ${imgname})
-# TODO(torben) check if this code is necessary in future.
## Added for persistent support.
elif [[ "$userBranchFilePath" ]]; then
vmpath="$userBranchFilePath"
diff --git a/remote/modules/vmchooser/data/opt/openslx/bin/xmlfilter.sh b/remote/modules/vmchooser/data/opt/openslx/bin/xmlfilter.sh
index 67e49d3e..67e49d3e 100755..100644
--- a/remote/modules/vmchooser/data/opt/openslx/bin/xmlfilter.sh
+++ b/remote/modules/vmchooser/data/opt/openslx/bin/xmlfilter.sh