diff --git a/samples/vboxwrapper/vbox_common.cpp b/samples/vboxwrapper/vbox_common.cpp index 4a4fa7ae91..42664be020 100644 --- a/samples/vboxwrapper/vbox_common.cpp +++ b/samples/vboxwrapper/vbox_common.cpp @@ -892,181 +892,6 @@ int VBOX_BASE::launch_vboxsvc() { return retval; } -// Launch the VM. -int VBOX_BASE::launch_vboxvm() { - char cmdline[1024]; - char* argv[5]; - int argc; - string output; - int retval = ERR_EXEC; - - // Construct the command line parameters - // - if (headless) { - argv[0] = const_cast("VboxHeadless.exe"); - } else { - argv[0] = const_cast("VirtualBox.exe"); - } - argv[1] = const_cast("--startvm"); - argv[2] = const_cast(vm_name.c_str()); - if (headless) { - argv[3] = const_cast("--vrde config"); - } else { - argv[3] = const_cast("--no-startvm-errormsgbox"); - } - argv[4] = NULL; - argc = 4; - - strcpy(cmdline, ""); - for (int i=0; i= 1000)) break; - - Sleep(250); - ulExitTimeout += 250; - } - - if (ulExitCode != STILL_ACTIVE) { - sanitize_output(output); - vboxlog_msg( - "Status Report: Virtualbox.exe/Vboxheadless.exe exited prematurely." - ); - vboxlog_msg( - " Exit Code: %d", - ulExitCode - ); - vboxlog_msg( - " Output: %s", - output.c_str() - ); - } - - if (pi.hProcess && (ulExitCode == STILL_ACTIVE)) { - vm_pid = pi.dwProcessId; - vm_pid_handle = pi.hProcess; - retval = BOINC_SUCCESS; - } - -CLEANUP: - if (pi.hThread) CloseHandle(pi.hThread); - if (hReadPipe) CloseHandle(hReadPipe); - if (hWritePipe) CloseHandle(hWritePipe); - -#else - int pid = fork(); - if (-1 == pid) { - vboxlog_msg( - "Status Report: Launching virtualbox/vboxheadless failed." - ); - vboxlog_msg( - " Error: %s (%d)", - strerror(errno), - errno - ); - retval = ERR_FORK; - } else if (0 == pid) { - if (-1 == execv(argv[0], argv)) { - _exit(errno); - } - } else { - vm_pid = pid; - retval = BOINC_SUCCESS; - } -#endif - - string cmd_line = cmdline; - vbm_trace(cmd_line, output, retval); - - return retval; -} - // If there are errors we can recover from, process them here. // int VBOX_BASE::vbm_popen(string& command, string& output, const char* item, bool log_error, bool retry_failures, unsigned int timeout, bool log_trace) { diff --git a/samples/vboxwrapper/vbox_common.h b/samples/vboxwrapper/vbox_common.h index 164381136e..0b4b769734 100644 --- a/samples/vboxwrapper/vbox_common.h +++ b/samples/vboxwrapper/vbox_common.h @@ -213,7 +213,6 @@ struct VBOX_BASE : VBOX_JOB { static void sanitize_output(string& output); int launch_vboxsvc(); - int launch_vboxvm(); int vbm_popen( string& command, string& output, const char* item,