From 0ee90d7995118ff5fd00c68af734050172f7733a Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Fri, 9 Oct 2015 12:38:28 -0400 Subject: [PATCH] VBOX: Update CPU VMX/SVM usage detection code with the latest error messages returned by VirtualBox 5.x --- samples/vboxwrapper/vbox_common.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/samples/vboxwrapper/vbox_common.cpp b/samples/vboxwrapper/vbox_common.cpp index 66afaaf103..27f0ab8859 100644 --- a/samples/vboxwrapper/vbox_common.cpp +++ b/samples/vboxwrapper/vbox_common.cpp @@ -316,6 +316,11 @@ bool VBOX_BASE::is_vm_machine_configuration_available() { return false; } + +// Updates for VirtualBox errors dealing with CPU exceleration can be found here: +// https://www.virtualbox.org/browser/vbox/trunk/src/VBox/VMM/VMMR3/HM.cpp#L599 +// + bool VBOX_BASE::is_logged_failure_vm_extensions_disabled() { if (vm_log.find("VERR_VMX_MSR_LOCKED_OR_DISABLED") != string::npos) return true; if (vm_log.find("VERR_SVM_DISABLED") != string::npos) return true; @@ -324,6 +329,11 @@ bool VBOX_BASE::is_logged_failure_vm_extensions_disabled() { if (vm_log.find("VERR_VMX_MSR_VMXON_DISABLED") != string::npos) return true; if (vm_log.find("VERR_VMX_MSR_SMX_VMXON_DISABLED") != string::npos) return true; + // VirtualBox 5.x or better + if (vm_log.find("VERR_VMX_MSR_VMX_DISABLED") != string::npos) return true; + if (vm_log.find("VERR_VMX_MSR_ALL_VMX_DISABLED") != string::npos) return true; + if (vm_log.find("VERR_VMX_MSR_LOCKING_FAILED") != string::npos) return true; + return false; } @@ -339,6 +349,10 @@ bool VBOX_BASE::is_logged_failure_vm_extensions_not_supported() { return false; } +// +// +// + bool VBOX_BASE::is_logged_failure_vm_powerup() { if (vm_log.find("Power up failed (vrc=VINF_SUCCESS, rc=E_FAIL (0X80004005))") != string::npos) return true; return false;