- 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
This commit is contained in:
Rom Walton 2012-01-08 20:18:14 +00:00
parent e8657adfd2
commit 6d731ccc6d
2 changed files with 76 additions and 66 deletions

View File

@ -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

View File

@ -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,