From b7f4b13342475cce18e2c92a529fe0482b9411e6 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Tue, 11 Oct 2011 20:01:32 +0000 Subject: [PATCH] - vbox: Move the destination of the VBOX_USER_HOME environment variable to /projects/virtualbox so that the virtualbox configuration can remain consistent across one or more projects. samples/vboxwrapper/ vbox.cpp svn path=/trunk/boinc/; revision=24380 --- checkin_notes | 8 ++++++++ samples/vboxwrapper/vbox.cpp | 10 ++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/checkin_notes b/checkin_notes index 523ca2584c..e118885252 100644 --- a/checkin_notes +++ b/checkin_notes @@ -7100,3 +7100,11 @@ David 11 Oct 2011 host.inc lib/ coproc.cpp + +Rom 11 Oct 2011 + - vbox: Move the destination of the VBOX_USER_HOME environment variable to + /projects/virtualbox so that the virtualbox configuration + can remain consistent across one or more projects. + + samples/vboxwrapper/ + vbox.cpp diff --git a/samples/vboxwrapper/vbox.cpp b/samples/vboxwrapper/vbox.cpp index 4807419f56..76905524cb 100644 --- a/samples/vboxwrapper/vbox.cpp +++ b/samples/vboxwrapper/vbox.cpp @@ -384,14 +384,14 @@ int VBOX_VM::get_install_directory(string& virtualbox_install_directory ) { int VBOX_VM::initialize() { string virtualbox_install_directory; - string virtual_machine_slot_directory; string old_path; string new_path; string virtualbox_user_home; + APP_INIT_DATA aid; char buf[256]; + boinc_get_init_data_p(&aid); get_install_directory(virtualbox_install_directory); - get_slot_directory(virtual_machine_slot_directory); // Prep the environment so we can execute the vboxmanage application // @@ -416,8 +416,10 @@ int VBOX_VM::initialize() { // Set the location in which the VirtualBox Configuration files can be // stored for this instance. // - virtualbox_user_home = virtual_machine_slot_directory; - virtualbox_user_home += "/vbox"; + virtualbox_user_home = aid.project_dir; + virtualbox_user_home += "/../virtualbox"; + + if (!boinc_file_exists(virtualbox_user_home.c_str())) boinc_mkdir(virtualbox_user_home.c_str()); #ifdef _WIN32 if (!SetEnvironmentVariable("VBOX_USER_HOME", const_cast(virtualbox_user_home.c_str()))) {