Gitlab@AEI Hannover will go down for maintenance on 2020-09-21 at 4:00 UTC. The service will be unavailable for up to 24 hours. If you have questions about this please contact atlas_admin@aei.mpg.de

Commit cfca0d21 authored by Rom Walton's avatar Rom Walton Committed by Oliver Bock

- VBOX: Record what version of VirtualBox was used, as well as whether

        anonymous platform was specified for the project.
parent d1d200b2
......@@ -7945,3 +7945,11 @@ Rom 28 Dec 2012
samples\vboxwrapper\
vbox.cpp
Rom 28 Dec 2012
- VBOX: Record what version of VirtualBox was used, as well as whether
anonymous platform was specified for the project.
samples\vboxwrapper\
vbox.cpp, .h
vboxwrapper.cpp
......@@ -58,6 +58,7 @@ using std::string;
#include "vbox.h"
VBOX_VM::VBOX_VM() {
virtualbox_version.clear();
pFloppy = NULL;
vm_master_name.clear();
vm_name.clear();
......@@ -112,6 +113,8 @@ int VBOX_VM::initialize() {
string old_path;
string new_path;
string virtualbox_user_home;
string command;
string output;
APP_INIT_DATA aid;
bool force_sandbox = false;
char buf[256];
......@@ -208,6 +211,12 @@ int VBOX_VM::initialize() {
#endif
}
// Record the VirtualBox version information for later use.
command = "--version ";
vbm_popen(command, output, "version check");
virtualbox_version = "VirtualBox " + output;
return 0;
}
......
......@@ -29,6 +29,9 @@ struct VBOX_VM {
VBOX_VM();
~VBOX_VM();
// Virtualbox Version Information
std::string virtualbox_version;
// Floppy IO abstraction
FloppyIO* pFloppy;
......
......@@ -397,6 +397,26 @@ int main(int argc, char** argv) {
vboxwrapper_msg_prefix(buf, sizeof(buf))
);
#if defined(_WIN32) && defined(USE_WINSOCK)
WSADATA wsdata;
retval = WSAStartup( MAKEWORD( 1, 1 ), &wsdata);
if (retval) {
fprintf(
stderr,
"%s can't initialize winsock: %d\n",
vboxwrapper_msg_prefix(buf, sizeof(buf)),
retval
);
boinc_finish(retval);
}
#endif
// Prepare environment for detecting system conditions
//
boinc_get_init_data_p(&aid);
// Initialize VM Hypervisor
//
retval = vm.initialize();
if (retval) {
fprintf(
......@@ -421,20 +441,29 @@ int main(int argc, char** argv) {
boinc_temporary_exit(300, "Communication with VM Hypervisor failed.");
}
#if defined(_WIN32) && defined(USE_WINSOCK)
WSADATA wsdata;
retval = WSAStartup( MAKEWORD( 1, 1 ), &wsdata);
if (retval) {
// Record what version of VirtualBox was used.
//
if (!vm.virtualbox_version.empty()) {
fprintf(
stderr,
"%s can't initialize winsock: %d\n",
"%s Detected: %s\n",
vboxwrapper_msg_prefix(buf, sizeof(buf)),
retval
vm.virtualbox_version.c_str()
);
}
// Record if anonymous platform was used.
//
if (boinc_file_exists(aid.project_dir + "/app_info.xml")) {
fprintf(
stderr,
"%s Detected: Anonymous Platform Enabled\n",
vboxwrapper_msg_prefix(buf, sizeof(buf))
);
boinc_finish(retval);
}
#endif
// Parse Job File
//
retval = parse_job_file(vm, copy_to_shared);
if (retval) {
fprintf(
......@@ -493,7 +522,8 @@ int main(int argc, char** argv) {
}
}
boinc_get_init_data_p(&aid);
// Configure Instance specific VM Parameters
//
vm.vm_master_name = "boinc_";
vm.image_filename = IMAGE_FILENAME_COMPLETE;
if (boinc_is_standalone()) {
......@@ -525,10 +555,12 @@ int main(int argc, char** argv) {
}
// Restore from checkpoint
//
read_checkpoint(checkpoint_cpu_time, vm);
elapsed_time = checkpoint_cpu_time;
// Should we even try to start things up?
//
if (vm.job_duration && (elapsed_time > vm.job_duration)) {
return EXIT_TIME_LIMIT_EXCEEDED;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment