mirror of https://github.com/BOINC/boinc.git
VBOX: If Detection of VirtualBox fails, declare it a temporary failure and reschedule after 24-hours.
6.10 and older do not detect if VirtualBox has been installed. If a VM job is assigned to a host running on an old client and the wrapper detects VirtualBox is not installed reschedule the job for execution at a later date. This prevents the client from requesting excessive amounts of work which will all fail. Eventually the job will error out when it passes its deadline.
This commit is contained in:
parent
3d60ae2508
commit
56974bff70
|
@ -109,6 +109,7 @@ VBOX_VM::~VBOX_VM() {
|
|||
}
|
||||
|
||||
int VBOX_VM::initialize() {
|
||||
int rc = 0;
|
||||
string virtualbox_install_directory;
|
||||
string old_path;
|
||||
string new_path;
|
||||
|
@ -120,7 +121,9 @@ int VBOX_VM::initialize() {
|
|||
char buf[256];
|
||||
|
||||
boinc_get_init_data_p(&aid);
|
||||
get_install_directory(virtualbox_install_directory);
|
||||
|
||||
rc = get_install_directory(virtualbox_install_directory);
|
||||
if (rc) return rc;
|
||||
|
||||
// Prep the environment so we can execute the vboxmanage application
|
||||
//
|
||||
|
@ -1130,15 +1133,19 @@ int VBOX_VM::get_install_directory(string& virtualbox_install_directory ) {
|
|||
|
||||
if (hkSetupHive) RegCloseKey(hkSetupHive);
|
||||
if (lpszRegistryValue) free(lpszRegistryValue);
|
||||
if (virtualbox_install_directory.empty()) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
virtualbox_install_directory = "";
|
||||
#endif
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Returns the current directory in which the executable resides.
|
||||
//
|
||||
int VBOX_VM::get_slot_directory( string& dir ) {
|
||||
int VBOX_VM::get_slot_directory(string& dir) {
|
||||
char slot_dir[256];
|
||||
|
||||
getcwd(slot_dir, sizeof(slot_dir));
|
||||
|
|
|
@ -421,11 +421,10 @@ int main(int argc, char** argv) {
|
|||
if (retval) {
|
||||
fprintf(
|
||||
stderr,
|
||||
"%s failed to initialize VM Hypervisor environment: %d\n",
|
||||
vboxwrapper_msg_prefix(buf, sizeof(buf)),
|
||||
retval
|
||||
"%s couldn't detect VM Hypervisor, telling BOINC to reschedule execution for a later date.\n",
|
||||
vboxwrapper_msg_prefix(buf, sizeof(buf))
|
||||
);
|
||||
boinc_finish(retval);
|
||||
boinc_temporary_exit(86400, "Detection of VM Hypervisor failed.");
|
||||
}
|
||||
|
||||
// Check to see if the system is in a state in which we expect to be able to run
|
||||
|
|
Loading…
Reference in New Issue