mirror of https://github.com/BOINC/boinc.git
VBOX: Check for the error condition in is_registered() before the success condition.
This commit is contained in:
parent
932cdbf84f
commit
e937368db7
|
@ -58,11 +58,6 @@ using std::string;
|
|||
#include "vbox.h"
|
||||
|
||||
|
||||
// Known VirtualBox error codes
|
||||
//
|
||||
#define VBOX_E_INVALID_OBJECT_STATE 0x80bb0007
|
||||
|
||||
|
||||
VBOX_VM::VBOX_VM() {
|
||||
virtualbox_home_directory.clear();
|
||||
virtualbox_install_directory.clear();
|
||||
|
@ -1599,12 +1594,12 @@ bool VBOX_VM::is_registered() {
|
|||
retval = vbm_popen(command, output, "registration", false, false);
|
||||
|
||||
// Handle explicit cases first
|
||||
if (!retval && output.find(needle.c_str()) != string::npos) {
|
||||
return true;
|
||||
}
|
||||
if (output.find("VBOX_E_OBJECT_NOT_FOUND") != string::npos) {
|
||||
return false;
|
||||
}
|
||||
if (!retval && output.find(needle.c_str()) != string::npos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Something unexpected has happened. Dump diagnostic output.
|
||||
fprintf(
|
||||
|
|
|
@ -21,6 +21,15 @@
|
|||
#ifndef _VBOX_H_
|
||||
#define _VBOX_H_
|
||||
|
||||
// Known VirtualBox/COM error codes
|
||||
//
|
||||
#ifndef RPC_S_SERVER_UNAVAILABLE
|
||||
#define RPC_S_SERVER_UNAVAILABLE 0x800706ba
|
||||
#endif
|
||||
#ifndef VBOX_E_INVALID_OBJECT_STATE
|
||||
#define VBOX_E_INVALID_OBJECT_STATE 0x80bb0007
|
||||
#endif
|
||||
|
||||
// raw floppy drive device
|
||||
class FloppyIO;
|
||||
|
||||
|
|
|
@ -659,7 +659,18 @@ int main(int argc, char** argv) {
|
|||
char* temp_reason = (char*)"";
|
||||
int temp_delay = 300;
|
||||
|
||||
if (vm.is_logged_failure_vm_extensions_disabled()) {
|
||||
if (ERR_NOT_EXITED == retval) {
|
||||
error_reason =
|
||||
" NOTE: VM was already running.\n"
|
||||
" BOINC will be notified that it needs to clean up the environment.\n"
|
||||
" This might be a temporary problem and so this job will be rescheduled for another time.\n";
|
||||
unrecoverable_error = false;
|
||||
temp_reason = (char*)"VM environment needed to be cleaned up.";
|
||||
} else if (ERR_INVALID_PARAM == retval) {
|
||||
unrecoverable_error = false;
|
||||
temp_reason = (char*)"Please upgrade BOINC to the latest version.";
|
||||
temp_delay = 86400;
|
||||
} else if (vm.is_logged_failure_vm_extensions_disabled()) {
|
||||
error_reason =
|
||||
" NOTE: BOINC has detected that your computer's processor supports hardware acceleration for\n"
|
||||
" virtual machines but the hypervisor failed to successfully launch with this feature enabled.\n"
|
||||
|
@ -688,13 +699,6 @@ int main(int argc, char** argv) {
|
|||
" This might be a temporary problem and so this job will be rescheduled for another time.\n";
|
||||
unrecoverable_error = false;
|
||||
temp_reason = (char*)"VM Hypervisor was unable to allocate enough memory to start VM.";
|
||||
} else if (ERR_NOT_EXITED == retval) {
|
||||
error_reason =
|
||||
" NOTE: VM was already running.\n"
|
||||
" BOINC will be notified that it needs to clean up the environment.\n"
|
||||
" This might be a temporary problem and so this job will be rescheduled for another time.\n";
|
||||
unrecoverable_error = false;
|
||||
temp_reason = (char*)"VM environment needed to be cleaned up.";
|
||||
} else if (vm.is_virtualbox_error_recoverable(retval)) {
|
||||
error_reason =
|
||||
" NOTE: VM session lock error encountered.\n"
|
||||
|
@ -702,10 +706,6 @@ int main(int argc, char** argv) {
|
|||
" This might be a temporary problem and so this job will be rescheduled for another time.\n";
|
||||
unrecoverable_error = false;
|
||||
temp_reason = (char*)"VM environment needed to be cleaned up.";
|
||||
} else if (ERR_INVALID_PARAM == retval) {
|
||||
unrecoverable_error = false;
|
||||
temp_reason = (char*)"Please upgrade BOINC to the latest version.";
|
||||
temp_delay = 86400;
|
||||
} else {
|
||||
dump_hypervisor_logs = true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue