summaryrefslogtreecommitdiffstats
path: root/remote/modules/vmplayer/data
diff options
context:
space:
mode:
authorJonathan Bauer2013-08-12 15:31:50 +0200
committerJonathan Bauer2013-08-12 15:31:50 +0200
commitfdf7b645edfc948f2fc03bb929517fbbd82b9437 (patch)
tree18eb9afd1d809e08452d328e83f1d3706f5f6003 /remote/modules/vmplayer/data
parent[clone_stage4] fix BASE_DIR <-> BASEDIR (diff)
parentMake script more compatible to different shell versions. (diff)
downloadtm-scripts-fdf7b645edfc948f2fc03bb929517fbbd82b9437.tar.gz
tm-scripts-fdf7b645edfc948f2fc03bb929517fbbd82b9437.tar.xz
tm-scripts-fdf7b645edfc948f2fc03bb929517fbbd82b9437.zip
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
Diffstat (limited to 'remote/modules/vmplayer/data')
-rwxr-xr-x[-rw-r--r--]remote/modules/vmplayer/data/opt/openslx/etc/vmware/run-virt.include28
1 files changed, 24 insertions, 4 deletions
diff --git a/remote/modules/vmplayer/data/opt/openslx/etc/vmware/run-virt.include b/remote/modules/vmplayer/data/opt/openslx/etc/vmware/run-virt.include
index 675835a9..084828ff 100644..100755
--- a/remote/modules/vmplayer/data/opt/openslx/etc/vmware/run-virt.include
+++ b/remote/modules/vmplayer/data/opt/openslx/etc/vmware/run-virt.include
@@ -230,7 +230,9 @@ MemTrimRate = "-1"
# ide-disks
ide0:0.present = "$ide"
ide0:0.fileName = "$diskfile"
-ide0:0.mode = "independent-nonpersistent"
+## Edited for persistent mode.
+ide0:0.mode = "independent-${diskmode}"
+##
ide1:0.present = "$cdrom0"
ide1:0.autodetect = "TRUE"
ide1:0.fileName = "auto detect"
@@ -245,7 +247,9 @@ scsi0.present = "$scsi"
scsi0:0.present = "$scsi"
scsi0:0.fileName = "$diskfile"
scsi0.virtualDev = "$hddrv"
-scsi0:0.mode = "independent-nonpersistent"
+## Edited for persistent mode.
+scsi0:0.mode = "independent-${diskmode}"$stateFileConfiguration
+##
# floppies
floppy0.present = "$floppy0"
@@ -459,7 +463,7 @@ esac
# check for whitelisted HW-3D
. /opt/openslx/config
-local FORCE3D=""
+FORCE3D=""
if [ -n "$SLX_VMWARE_3D" ]; then
FORCE3D='mks.gl.allowBlacklistedDrivers = "TRUE"'
fi
@@ -512,6 +516,20 @@ esac
# check if ide/scsi and hwver of image
# read only the first 30 lines to be sure
imghead=$(head -n 30 "${diskfile}")
+## Added to handle persistent snapshots.
+if [[ "$originalVMDKFilePath" ]]; then
+ echo "Select \"${originalVMDKFilePath}\" as information base for \"${diskfile}\"."
+ imghead=$(head -n 30 "$originalVMDKFilePath") && \
+ # Support suspend mode.
+ stateFilePath="$(readlink -f "$(dirname "$diskfile")/"*.vmss)" && \
+ if [ -f "$stateFilePath" ]; then
+ echo "Found state file \"$stateFilePath\"." && \
+ stateFileConfiguration="
+checkpoint.vmState = \"$stateFilePath\""
+ fi
+ POSTRUN="stateFilePath=\"\$(readlink -f \"${confdir}/\"*.vmss)\" && memoryFilePath=\"\$(readlink -f \"${confdir}/\"*.vmem)\" && [ -f \"\$stateFilePath\" ] && echo \"Saving state and memory file \\\"\$stateFilePath\\\" and \\\"\$memoryFilePath\\\".\" && mv -f \"\$stateFilePath\" \"$(dirname "$diskfile")/\" && mv -f \"\$memoryFilePath\" \"$(dirname "$diskfile")/\""
+fi
+##
hddrv=$(echo "${imghead}" | grep -m1 -ia "ddb.adapterType" | awk -F '"' '{print $2}')
hwver=$(echo "${imghead}" | grep -m1 -ia "ddb.virtualHWVersion" | awk -F '"' '{print $2}')
case "${hddrv}" in
@@ -557,7 +575,9 @@ cp "/opt/openslx/etc/vmware/nvram" "$confdir/nvram" 2>/dev/null
# log script information
writelog "# File created by $0 (VMversion ${vmversion})\n# on $(date)\n"
-writelog "Starting with non-persistent mode ...\n"
+## Edited for persistent mode.
+writelog "Starting with ${diskmode} mode ...\n"
+##
# write all results to logfile
# log disksetup