summaryrefslogtreecommitdiffstats
path: root/remote/modules/vmplayer/data
diff options
context:
space:
mode:
authorDirk2013-08-09 14:35:07 +0200
committerDirk2013-08-09 14:35:07 +0200
commit0493d59528af1b38a7af94f1e34190eab25d2e9c (patch)
treef9700d9df3a13a30bacd96f3fcc6bf16cba6f9f4 /remote/modules/vmplayer/data
parentCreate /etc/issue dynamically ... (see issue #481) (diff)
parentFix statefile moving. (diff)
downloadtm-scripts-0493d59528af1b38a7af94f1e34190eab25d2e9c.tar.gz
tm-scripts-0493d59528af1b38a7af94f1e34190eab25d2e9c.tar.xz
tm-scripts-0493d59528af1b38a7af94f1e34190eab25d2e9c.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