VBOX: Do not go off the rails if a process handle cannot be obtained for the VM process. Changing process priority of a Virtualbox 4.3.14 VM does not currently work.

This commit is contained in:
Rom Walton 2014-07-12 15:27:03 -04:00
parent 077c05bd89
commit fa7ebdca4e
1 changed files with 5 additions and 11 deletions

View File

@ -1230,11 +1230,7 @@ int VBOX_VM::start() {
get_vm_process_id(); get_vm_process_id();
#ifdef _WIN32
if (vm_pid && vm_pid_handle) break;
#else
if (vm_pid) break; if (vm_pid) break;
#endif
if (timeout > 45) { if (timeout > 45) {
retval = ERR_TIMEOUT; retval = ERR_TIMEOUT;
@ -2022,10 +2018,8 @@ int VBOX_VM::get_vm_process_id() {
string pid; string pid;
size_t pid_start; size_t pid_start;
size_t pid_end; size_t pid_end;
int retval;
retval = get_vm_log(output, false); get_vm_log(output, false);
if (retval) return retval;
// Output should look like this: // Output should look like this:
// VirtualBox 4.1.0 r73009 win.amd64 (Jul 19 2011 13:05:53) release log // VirtualBox 4.1.0 r73009 win.amd64 (Jul 19 2011 13:05:53) release log
@ -2177,7 +2171,7 @@ int VBOX_VM::get_system_log(string& log, bool tail_only) {
} else { } else {
fprintf( fprintf(
stderr, stderr,
"%s ERROR: Stale VirtualBox System Log used.\n", "%s WARNING: Stale VirtualBox System Log used.\n",
vboxwrapper_msg_prefix(buf, sizeof(buf)) vboxwrapper_msg_prefix(buf, sizeof(buf))
); );
} }
@ -2208,7 +2202,7 @@ int VBOX_VM::get_system_log(string& log, bool tail_only) {
} else { } else {
fprintf( fprintf(
stderr, stderr,
"%s ERROR: Stale VirtualBox System Log Not Found.\n", "%s WARNING: Stale VirtualBox System Log Not Found.\n",
vboxwrapper_msg_prefix(buf, sizeof(buf)) vboxwrapper_msg_prefix(buf, sizeof(buf))
); );
retval = ERR_NOT_FOUND; retval = ERR_NOT_FOUND;
@ -2239,7 +2233,7 @@ int VBOX_VM::get_vm_log(string& log, bool tail_only) {
} else { } else {
fprintf( fprintf(
stderr, stderr,
"%s ERROR: Stale VirtualBox VM Log used.\n", "%s WARNING: Stale VirtualBox VM Log used.\n",
vboxwrapper_msg_prefix(buf, sizeof(buf)) vboxwrapper_msg_prefix(buf, sizeof(buf))
); );
} }
@ -2271,7 +2265,7 @@ int VBOX_VM::get_vm_log(string& log, bool tail_only) {
} else { } else {
fprintf( fprintf(
stderr, stderr,
"%s ERROR: Stale VirtualBox VM Log Not Found.\n", "%s WARNING: Stale VirtualBox VM Log Not Found.\n",
vboxwrapper_msg_prefix(buf, sizeof(buf)) vboxwrapper_msg_prefix(buf, sizeof(buf))
); );
retval = ERR_NOT_FOUND; retval = ERR_NOT_FOUND;