From 6d731ccc6de927718995892bb614688b3bd167c9 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Sun, 8 Jan 2012 20:18:14 +0000 Subject: [PATCH] - VBOX: Fix regression where the ERR_CPU_VM_EXTENSIONS_DISABLED error message wasn't being written to stderr when the VM extensions were disabled via the BIOS. samples/vboxwrapper/ vboxwrapper.cpp svn path=/trunk/boinc/; revision=25010 --- checkin_notes | 8 ++ samples/vboxwrapper/vboxwrapper.cpp | 134 ++++++++++++++-------------- 2 files changed, 76 insertions(+), 66 deletions(-) diff --git a/checkin_notes b/checkin_notes index 212f0660f1..1d116bac37 100644 --- a/checkin_notes +++ b/checkin_notes @@ -290,3 +290,11 @@ David 7 Jan 2012 sched_types.h sched_customize.cpp validator.cpp + +Rom 8 Jan 2012 + - VBOX: Fix regression where the ERR_CPU_VM_EXTENSIONS_DISABLED error + message wasn't being written to stderr when the VM extensions + were disabled via the BIOS. + + samples/vboxwrapper/ + vboxwrapper.cpp diff --git a/samples/vboxwrapper/vboxwrapper.cpp b/samples/vboxwrapper/vboxwrapper.cpp index a637dbda8d..c0fd83167e 100644 --- a/samples/vboxwrapper/vboxwrapper.cpp +++ b/samples/vboxwrapper/vboxwrapper.cpp @@ -383,15 +383,62 @@ int main(int argc, char** argv) { fprintf( stderr, - "%s Hypervisor System Log:\n\n" - "%s\n" - "%s VM Execution Log:\n\n" - "%s\n", - boinc_msg_prefix(buf, sizeof(buf)), - system_log.c_str(), - boinc_msg_prefix(buf, sizeof(buf)), - vm_log.c_str() + "%s VM failed to startup!!!\n", + boinc_msg_prefix(buf, sizeof(buf)) ); + if ((vm_log.find("VERR_VMX_MSR_LOCKED_OR_DISABLED") != std::string::npos) || (vm_log.find("VERR_SVM_DISABLED") != std::string::npos)) { + fprintf( + stderr, + "%s NOTE: BOINC has detected that your processor supports hardware acceleration for virtual machines\n" + "%s but the hypervisor failed to successfully launch with this feature enabled. This means that the\n" + "%s hardware acceleration feature has been disabled in the computers BIOS. Please enable this\n" + "%s feature in your BIOS.\n" + "%s Intel Processors call it 'VT-x'\n" + "%s AMD Processors call it 'AMD-V'\n" + "%s More information can be found here: http://en.wikipedia.org/wiki/X86_virtualization\n" + "%s Error Code: ERR_CPU_VM_EXTENSIONS_DISABLED\n", + boinc_msg_prefix(buf, sizeof(buf)), + boinc_msg_prefix(buf, sizeof(buf)), + boinc_msg_prefix(buf, sizeof(buf)), + boinc_msg_prefix(buf, sizeof(buf)), + boinc_msg_prefix(buf, sizeof(buf)), + boinc_msg_prefix(buf, sizeof(buf)), + boinc_msg_prefix(buf, sizeof(buf)), + boinc_msg_prefix(buf, sizeof(buf)) + ); + } else if ((vm_log.find("VERR_VMX_IN_VMX_ROOT_MODE") != std::string::npos) || (vm_log.find("VERR_SVM_IN_USE") != std::string::npos)) { + fprintf( + stderr, + "%s NOTE: VirtualBox hypervisor reports that another hypervisor has locked the hardware acceleration\n" + "%s for virtual machines feature in exclusive mode. You'll either need to reconfigure the other hypervisor\n" + "%s to not use the feature exclusively or just shut it down while running BOINC with this project.\n", + boinc_msg_prefix(buf, sizeof(buf)), + boinc_msg_prefix(buf, sizeof(buf)), + boinc_msg_prefix(buf, sizeof(buf)) + ); + } else if ((vm_log.find("VERR_VMX_NO_VMX") != std::string::npos) || (vm_log.find("VERR_SVM_NO_SVM") != std::string::npos)) { + fprintf( + stderr, + "%s NOTE: VirtualBox has reported an improperly configured virtual machine. It was configured to require\n" + "%s hardware acceleration for virtual machines, but your processor does not support the required feature.\n" + "%s Please report this issue to the project so that it can be addresssed.\n", + boinc_msg_prefix(buf, sizeof(buf)), + boinc_msg_prefix(buf, sizeof(buf)), + boinc_msg_prefix(buf, sizeof(buf)) + ); + } else { + fprintf( + stderr, + "%s Hypervisor System Log:\n\n" + "%s\n" + "%s VM Execution Log:\n\n" + "%s\n", + boinc_msg_prefix(buf, sizeof(buf)), + system_log.c_str(), + boinc_msg_prefix(buf, sizeof(buf)), + vm_log.c_str() + ); + } boinc_finish(retval); } @@ -429,65 +476,20 @@ int main(int argc, char** argv) { fprintf( stderr, "%s VM Premature Shutdown Detected!!!\n", - boinc_msg_prefix(buf, sizeof(buf)) + "%s NOTE: This could be like a blue-screen event in Windows, the rest of the information in this file\n" + "%s is diagnostic information generated by the hypervisor.\n" + "%s Hypervisor System Log:\n\n" + "%s\n" + "%s VM Execution Log:\n\n" + "%s\n", + boinc_msg_prefix(buf, sizeof(buf)), + boinc_msg_prefix(buf, sizeof(buf)), + boinc_msg_prefix(buf, sizeof(buf)), + boinc_msg_prefix(buf, sizeof(buf)), + system_log.c_str(), + boinc_msg_prefix(buf, sizeof(buf)), + vm_log.c_str() ); - if ((vm_log.find("VERR_VMX_MSR_LOCKED_OR_DISABLED") != std::string::npos) || (vm_log.find("VERR_SVM_DISABLED") != std::string::npos)) { - fprintf( - stderr, - "%s NOTE: BOINC has detected that your processor supports hardware acceleration for virtual machines\n" - "%s but the hypervisor failed to successfully launch with this feature enabled. This means that the\n" - "%s hardware acceleration feature has been disabled in the computers BIOS. Please enable this\n" - "%s feature in your BIOS.\n" - "%s Intel Processors call it 'VT-x'\n" - "%s AMD Processors call it 'AMD-V'\n" - "%s More information can be found here: http://en.wikipedia.org/wiki/X86_virtualization\n" - "%s Error Code: ERR_CPU_VM_EXTENSIONS_DISABLED\n", - boinc_msg_prefix(buf, sizeof(buf)), - boinc_msg_prefix(buf, sizeof(buf)), - boinc_msg_prefix(buf, sizeof(buf)), - boinc_msg_prefix(buf, sizeof(buf)), - boinc_msg_prefix(buf, sizeof(buf)), - boinc_msg_prefix(buf, sizeof(buf)), - boinc_msg_prefix(buf, sizeof(buf)), - boinc_msg_prefix(buf, sizeof(buf)) - ); - } else if ((vm_log.find("VERR_VMX_IN_VMX_ROOT_MODE") != std::string::npos) || (vm_log.find("VERR_SVM_IN_USE") != std::string::npos)) { - fprintf( - stderr, - "%s NOTE: VirtualBox hypervisor reports that another hypervisor has locked the hardware acceleration\n" - "%s for virtual machines feature in exclusive mode. You'll either need to reconfigure the other hypervisor\n" - "%s to not use the feature exclusively or just shut it down while running BOINC with this project.\n", - boinc_msg_prefix(buf, sizeof(buf)), - boinc_msg_prefix(buf, sizeof(buf)), - boinc_msg_prefix(buf, sizeof(buf)) - ); - } else if ((vm_log.find("VERR_VMX_NO_VMX") != std::string::npos) || (vm_log.find("VERR_SVM_NO_SVM") != std::string::npos)) { - fprintf( - stderr, - "%s NOTE: VirtualBox has reported an improperly configured virtual machine. It was configured to require\n" - "%s hardware acceleration for virtual machines, but your processor does not support the required feature.\n" - "%s Please report this issue to the project so that it can be addresssed.\n", - boinc_msg_prefix(buf, sizeof(buf)), - boinc_msg_prefix(buf, sizeof(buf)), - boinc_msg_prefix(buf, sizeof(buf)) - ); - } else { - fprintf( - stderr, - "%s NOTE: This could be like a blue-screen event in Windows, the rest of the information in this file\n" - "%s is diagnostic information generated by the hypervisor.\n" - "%s Hypervisor System Log:\n\n" - "%s\n" - "%s VM Execution Log:\n\n" - "%s\n", - boinc_msg_prefix(buf, sizeof(buf)), - boinc_msg_prefix(buf, sizeof(buf)), - boinc_msg_prefix(buf, sizeof(buf)), - system_log.c_str(), - boinc_msg_prefix(buf, sizeof(buf)), - vm_log.c_str() - ); - } } else { fprintf( stderr,