From 91cbe2681037a3ed36c47a74c88af49804844246 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Tue, 30 Sep 2014 09:34:16 +0200 Subject: [PATCH] VBOX: Try and prevent vboxwrapper from starting the VM if BOINC has signaled boinc_status.quit_requit or boinc_status.no_heartbeat. --- samples/vboxwrapper/vbox.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/samples/vboxwrapper/vbox.cpp b/samples/vboxwrapper/vbox.cpp index 05003279a8..cd0fefec08 100644 --- a/samples/vboxwrapper/vbox.cpp +++ b/samples/vboxwrapper/vbox.cpp @@ -1266,6 +1266,15 @@ int VBOX_VM::run(bool do_restore_snapshot) { if (retval) return retval; } + // Has BOINC signaled that we should quit? + // Try to prevent starting the VM in an environment where we might be terminated any + // second. This can happen if BOINC has been told to shutdown or the volunteer has + // told BOINC to switch to a different project. + // + if (boinc_status.no_heartbeat || boinc_status.quit_request) { + return VBOXWRAPPER_ERR_RECOVERABLE; + } + // Start the VM retval = start(); if (retval) return retval;