From 718a68bf8060c17c602d73085bc5b2ca3a643c26 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Fri, 4 May 2018 16:38:17 +0200 Subject: [*virt*] fix vmware VM only having 1 core... --- .../run-virt-includes/set_runvirt_hardware_variables.inc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'core/modules/run-virt/data') diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc index c59a82b0..19e1cb43 100644 --- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc +++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc @@ -13,15 +13,15 @@ # Use: 00:FF:00 for firtual machines ;) ## Functions ## +# Import /run/hwinfo variables +import_hwinfo() { + $(safesource "/run/hwinfo") +} # Sets the VM's hostname to the original hostname prefixed with a fixed string and its ID set_virt_hostname() { declare -rg HOSTNAME="virt${VM_ID}-$(hostname)" writelog "\tVM Hostname:\t\t$HOSTNAME" } -set_virt_cpu() { - # Make sure CPU_CORES is not empty - declare -g CPU_CORES=${CPU_CORES:-"1"} -} # Derives the amount of memory allocated to the VM from the # host's total memory (previously determined by systemd-run_virt_env) set_virt_memory() { @@ -149,7 +149,7 @@ set_serial_ports() { ## MAIN ## call_post_source \ - set_virt_cpu \ + import_hwinfo \ set_virt_memory \ set_virt_mac \ set_virt_hostname \ -- cgit v1.2.3-55-g7522 From 4325b5aa2ce5f7f6e3e9ec7f59ff91d246c0903d Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Mon, 7 May 2018 16:45:37 +0200 Subject: [run-virt] wait before calling slxlog on exit 141 If the main run-virt script exits with 141 (which happens when it is killed by either loginctl on SLX_LOGOUT_TIMEOUT or when killing X with alt-printscreen-k), sleep 3 seconds to try and avoid the unnecessary slxlog messages. Closes #3365 --- core/modules/run-virt/data/opt/openslx/scripts/vmchooser-run_virt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/modules/run-virt/data') diff --git a/core/modules/run-virt/data/opt/openslx/scripts/vmchooser-run_virt b/core/modules/run-virt/data/opt/openslx/scripts/vmchooser-run_virt index 96a47ea6..307b6872 100755 --- a/core/modules/run-virt/data/opt/openslx/scripts/vmchooser-run_virt +++ b/core/modules/run-virt/data/opt/openslx/scripts/vmchooser-run_virt @@ -31,6 +31,11 @@ launch_runvirt() { # script exited here, check for exit code and send logfile to sat if appropriate local RUNVIRT_RET="$?" if [ ${RUNVIRT_RET} -ne 0 ]; then + if [ ${RUNVIRT_RET} -eq 141 ]; then + # 141 happens on alt + print screen + k or upon automatic logout via systemd + # just sleep here to avoid these annoying (and misleading) slxlogs.... + sleep 3 + fi [ -f "${LOGFILE}" ] && log "Runvirt failed with '${RUNVIRT_RET}'." return 1 fi -- cgit v1.2.3-55-g7522