Skip to content

Commit

Permalink
VBOX: Update CPU VMX/SVM usage detection code with the latest error m…
Browse files Browse the repository at this point in the history
…essages returned by VirtualBox 5.x
  • Loading branch information
romw committed Oct 9, 2015
1 parent aa542c6 commit 0ee90d7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions samples/vboxwrapper/vbox_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand All @@ -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;
Expand Down

0 comments on commit 0ee90d7

Please sign in to comment.