summaryrefslogtreecommitdiffstats
path: root/remote/modules/vmplayer
diff options
context:
space:
mode:
Diffstat (limited to 'remote/modules/vmplayer')
-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..9a817d65 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 --canonicalize \"${confdir}/\"*.vmss)\" && memoryFilePath=\"\$(readlink --canonicalize \"${confdir}/\"*.vmem)\" && [ -f \"\$stateFilePath\" ] && echo \"Saving state and memory file \\\"\$stateFilePath\\\" and \\\"\$memoryFilePath\\\".\" && mv --force \"\$stateFilePath\" \"$(dirname "$diskfile")/\" && mv --force \"\$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