summaryrefslogtreecommitdiffstats
path: root/remote/modules/vmware
diff options
context:
space:
mode:
authorSimon Rettberg2016-03-22 14:35:46 +0100
committerSimon Rettberg2016-03-22 14:35:46 +0100
commit65674c3d8915b2170b3a4f8c0722cf14dee52947 (patch)
tree81c743a69850ba45b5d4308693c81075d221a7c0 /remote/modules/vmware
parent[run-virt] Default to vmware shared folder for homedir for backwards compat (diff)
downloadtm-scripts-65674c3d8915b2170b3a4f8c0722cf14dee52947.tar.gz
tm-scripts-65674c3d8915b2170b3a4f8c0722cf14dee52947.tar.xz
tm-scripts-65674c3d8915b2170b3a4f8c0722cf14dee52947.zip
[run-virt/hwstats/vmware] Only enable KVM in guest if hw supports it
Otherwise vmware will refuse to start the virtual machine.
Diffstat (limited to 'remote/modules/vmware')
-rw-r--r--remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc8
1 files changed, 6 insertions, 2 deletions
diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc
index d86a707a..1c7aa533 100644
--- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc
+++ b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc
@@ -128,8 +128,12 @@ if [ -n "$SLX_EXAM" ]; then
fi
# Enable nested virtualization if not specified in remote vmx
-grep -qi '^vhv\.enable' "${TMPDIR}/${IMGUUID}" || echo 'vhv.enable = "TRUE"' >> "${TMPDIR}/${IMGUUID}"
-grep -qi '^vpmc\.enable' "${TMPDIR}/${IMGUUID}" || echo 'vpmc.enable = "TRUE"' >> "${TMPDIR}/${IMGUUID}"
+if [ -e "/run/hwinfo" ] && ! grep -qi '^vhv\.enable' "${TMPDIR}/${IMGUUID}"; then
+ . "/run/hwinfo"
+ [ "${HW_KVM}" = "ENABLED" ] && echo 'vhv.enable = "TRUE"' >> "${TMPDIR}/${IMGUUID}"
+fi
+# TODO: Need a way to check if supported by hardware before enabling!
+#grep -qi '^vpmc\.enable' "${TMPDIR}/${IMGUUID}" || echo 'vpmc.enable = "TRUE"' >> "${TMPDIR}/${IMGUUID}"
# Killing duplicate lines (output much nicer than sort -u):
awk '!a[$0]++' "${TMPDIR}/${IMGUUID}" > "${TMPDIR}/${IMGUUID}.tmp" && mv "${TMPDIR}/${IMGUUID}.tmp" "${TMPDIR}/${IMGUUID}"