- VBOX: Use the boinc_temporary_exit API properly. Wait for 5 minutes

before allowing another attempt to start the VM when the hypervisor
       cannot allocate enough memory.
    - VBOX: Print out a trace statement about the suspend/resume directive
       from the vboxwrapper perspective.  This in conjuction with the
       BOINC API trace statements should provide a better idea with
       what is going on.
       
    samples/vboxwrapper
        vboxwrapper.cpp

svn path=/trunk/boinc/; revision=25424
This commit is contained in:
Rom Walton 2012-03-14 18:54:03 +00:00
parent e76d18c6fc
commit a52651bf56
4 changed files with 37 additions and 11 deletions

View File

@ -2628,3 +2628,15 @@ Charlie 14 Mar 2012
client/ client/
coproc_detect.cpp coproc_detect.cpp
Rom 14 Mar 2012
- VBOX: Use the boinc_temporary_exit API properly. Wait for 5 minutes
before allowing another attempt to start the VM when the hypervisor
cannot allocate enough memory.
- VBOX: Print out a trace statement about the suspend/resume directive
from the vboxwrapper perspective. This in conjuction with the
BOINC API trace statements should provide a better idea with
what is going on.
samples/vboxwrapper
vboxwrapper.cpp

View File

@ -332,7 +332,6 @@ int main(int argc, char** argv) {
double ncpus = 0.0; double ncpus = 0.0;
bool report_vm_pid = false; bool report_vm_pid = false;
bool report_net_usage = false; bool report_net_usage = false;
bool unrecoverable_error = false;
int vm_pid = 0; int vm_pid = 0;
unsigned long vm_exit_code = 0; unsigned long vm_exit_code = 0;
std::string vm_log; std::string vm_log;
@ -450,12 +449,18 @@ int main(int argc, char** argv) {
retval = vm.run(); retval = vm.run();
if (retval) { if (retval) {
// All failure to start error are unrecoverable by default // All failure to start error are unrecoverable by default
unrecoverable_error = true; bool unrecoverable_error = true;
char* temp_reason = "";
int temp_delay = 300;
// Get logs before cleanup // Get logs before cleanup
vm.get_system_log(system_log); vm.get_system_log(system_log);
vm.get_vm_log(vm_log); vm.get_vm_log(vm_log);
// Attempt to cleanup the VM
vm.cleanup();
write_checkpoint(elapsed_time, vm);
fprintf( fprintf(
stderr, stderr,
"%s VM failed to start.\n", "%s VM failed to start.\n",
@ -499,6 +504,7 @@ int main(int argc, char** argv) {
vboxwrapper_msg_prefix(buf, sizeof(buf)) vboxwrapper_msg_prefix(buf, sizeof(buf))
); );
unrecoverable_error = false; unrecoverable_error = false;
temp_reason = "VM Hypervisor was unable to allocate enough memory to start VM.";
} else { } else {
fprintf( fprintf(
stderr, stderr,
@ -514,11 +520,9 @@ int main(int argc, char** argv) {
} }
if (unrecoverable_error) { if (unrecoverable_error) {
vm.cleanup();
write_checkpoint(elapsed_time, vm);
boinc_finish(retval); boinc_finish(retval);
} else { } else {
boinc_temporary_exit(0); boinc_temporary_exit(temp_delay, temp_reason);
} }
} }
@ -585,10 +589,20 @@ int main(int argc, char** argv) {
} }
if (boinc_status.suspended) { if (boinc_status.suspended) {
if (!vm.suspended) { if (!vm.suspended) {
fprintf(
stderr,
"%s Suspending VM.\n",
vboxwrapper_msg_prefix(buf, sizeof(buf))
);
vm.pause(); vm.pause();
} }
} else { } else {
if (vm.suspended) { if (vm.suspended) {
fprintf(
stderr,
"%s Resuming VM.\n",
vboxwrapper_msg_prefix(buf, sizeof(buf))
);
vm.resume(); vm.resume();
} }

View File

@ -186,7 +186,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include" AdditionalIncludeDirectories=".;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include"
PreprocessorDefinitions="WIN32;NDEBUG;_MT;_LIB;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS" PreprocessorDefinitions="WIN32;NDEBUG;_MT;_LIB;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS;BOINC_INFOMSGS"
ExceptionHandling="2" ExceptionHandling="2"
RuntimeLibrary="0" RuntimeLibrary="0"
UsePrecompiledHeader="2" UsePrecompiledHeader="2"
@ -255,7 +255,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include" AdditionalIncludeDirectories=".;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include"
PreprocessorDefinitions="WIN32;NDEBUG;_MT;_LIB;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS" PreprocessorDefinitions="WIN32;NDEBUG;_MT;_LIB;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS;BOINC_INFOMSGS"
ExceptionHandling="2" ExceptionHandling="2"
RuntimeLibrary="0" RuntimeLibrary="0"
UsePrecompiledHeader="2" UsePrecompiledHeader="2"

View File

@ -81,13 +81,13 @@
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="libcmt.lib libcpmt.lib kernel32.lib user32.lib gdi32.lib ole32.lib wsock32.lib" AdditionalDependencies="libcmt.lib libcpmt.lib kernel32.lib user32.lib gdi32.lib ole32.lib wsock32.lib"
OutputFile=".\Build\$(PlatformName)\$(ConfigurationName)\vboxwrapper_25399_windows_intelx86.exe" OutputFile=".\Build\$(PlatformName)\$(ConfigurationName)\vboxwrapper_25404_windows_intelx86.exe"
LinkIncremental="0" LinkIncremental="0"
SuppressStartupBanner="true" SuppressStartupBanner="true"
IgnoreAllDefaultLibraries="true" IgnoreAllDefaultLibraries="true"
DelayLoadDLLs="" DelayLoadDLLs=""
GenerateDebugInformation="true" GenerateDebugInformation="true"
ProgramDatabaseFile=".\Build\$(PlatformName)\$(ConfigurationName)\vboxwrapper_25399_windows_intelx86.pdb" ProgramDatabaseFile=".\Build\$(PlatformName)\$(ConfigurationName)\vboxwrapper_25404_windows_intelx86.pdb"
SubSystem="2" SubSystem="2"
TargetMachine="1" TargetMachine="1"
/> />
@ -182,13 +182,13 @@
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="libcmt.lib libcpmt.lib kernel32.lib user32.lib gdi32.lib ole32.lib wsock32.lib" AdditionalDependencies="libcmt.lib libcpmt.lib kernel32.lib user32.lib gdi32.lib ole32.lib wsock32.lib"
OutputFile=".\Build\$(PlatformName)\$(ConfigurationName)\vboxwrapper_25399_windows_x86_64.exe" OutputFile=".\Build\$(PlatformName)\$(ConfigurationName)\vboxwrapper_25404_windows_x86_64.exe"
LinkIncremental="0" LinkIncremental="0"
SuppressStartupBanner="true" SuppressStartupBanner="true"
IgnoreAllDefaultLibraries="true" IgnoreAllDefaultLibraries="true"
DelayLoadDLLs="" DelayLoadDLLs=""
GenerateDebugInformation="true" GenerateDebugInformation="true"
ProgramDatabaseFile=".\Build\$(PlatformName)\$(ConfigurationName)\vboxwrapper_25399_windows_x86_64.pdb" ProgramDatabaseFile=".\Build\$(PlatformName)\$(ConfigurationName)\vboxwrapper_25404_windows_x86_64.pdb"
SubSystem="2" SubSystem="2"
TargetMachine="17" TargetMachine="17"
/> />