Skip to content
Snippets Groups Projects
Commit 9f42c5dc authored by Rom Walton's avatar Rom Walton
Browse files

VBOX: Attempt to gracefully fallback to using vboxmanage when the COM...

VBOX: Attempt to gracefully fallback to using vboxmanage when the COM interface cannot be successfully created.
parent 86598c9c
No related branches found
No related tags found
No related merge requests found
...@@ -244,6 +244,7 @@ public: ...@@ -244,6 +244,7 @@ public:
}; };
class VBOX_VM : public VBOX_BASE { class VBOX_VM : public VBOX_BASE {
public:
VBOX_VM(); VBOX_VM();
~VBOX_VM(); ~VBOX_VM();
}; };
......
...@@ -454,19 +454,47 @@ int main(int argc, char** argv) { ...@@ -454,19 +454,47 @@ int main(int argc, char** argv) {
sscanf(vbox_version.c_str(), "%d.%d", &vbox_major, &vbox_minor); sscanf(vbox_version.c_str(), "%d.%d", &vbox_major, &vbox_minor);
if ((4 == vbox_major) && (2 == vbox_minor)) { if ((4 == vbox_major) && (2 == vbox_minor)) {
pVM = (VBOX_VM*) new vbox42::VBOX_VM(); pVM = (VBOX_VM*) new vbox42::VBOX_VM();
retval = pVM->initialize();
if (retval) {
delete pVM;
pVM = NULL;
}
} }
if ((4 == vbox_major) && (3 == vbox_minor)) { if ((4 == vbox_major) && (3 == vbox_minor)) {
pVM = (VBOX_VM*) new vbox43::VBOX_VM(); pVM = (VBOX_VM*) new vbox43::VBOX_VM();
retval = pVM->initialize();
if (retval) {
delete pVM;
pVM = NULL;
}
} }
if ((5 == vbox_major) && (0 == vbox_minor)) { if ((5 == vbox_major) && (0 >= vbox_minor)) {
pVM = (VBOX_VM*) new vbox50::VBOX_VM(); pVM = (VBOX_VM*) new vbox50::VBOX_VM();
retval = pVM->initialize();
if (retval) {
delete pVM;
pVM = NULL;
}
} }
} }
if (!pVM) { if (!pVM) {
pVM = (VBOX_VM*) new vboxmanage::VBOX_VM(); pVM = (VBOX_VM*) new vboxmanage::VBOX_VM();
retval = pVM->initialize();
if (retval) {
vboxlog_msg("Could not detect VM Hypervisor. Rescheduling execution for a later date.");
boinc_temporary_exit(86400, "Detection of VM Hypervisor failed.");
}
} }
#else #else
pVM = (VBOX_VM*) new vboxmanage::VBOX_VM(); pVM = (VBOX_VM*) new vboxmanage::VBOX_VM();
// Initialize VM Hypervisor
//
retval = pVM->initialize();
if (retval) {
vboxlog_msg("Could not detect VM Hypervisor. Rescheduling execution for a later date.");
boinc_temporary_exit(86400, "Detection of VM Hypervisor failed.");
}
#endif #endif
// Parse command line parameters // Parse command line parameters
...@@ -516,14 +544,6 @@ int main(int argc, char** argv) { ...@@ -516,14 +544,6 @@ int main(int argc, char** argv) {
} }
#endif #endif
// Initialize VM Hypervisor
//
retval = pVM->initialize();
if (retval) {
vboxlog_msg("Could not detect VM Hypervisor. Rescheduling execution for a later date.");
boinc_temporary_exit(86400, "Detection of VM Hypervisor failed.");
}
// Record what version of VirtualBox was used. // Record what version of VirtualBox was used.
// //
if (!pVM->virtualbox_version.empty()) { if (!pVM->virtualbox_version.empty()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment