mirror of https://github.com/BOINC/boinc.git
parent
c94af43ea3
commit
54c27ff947
|
@ -298,6 +298,7 @@ bool VBOX_VM::is_running() {
|
||||||
string vmstate;
|
string vmstate;
|
||||||
size_t vmstate_location;
|
size_t vmstate_location;
|
||||||
size_t vmstate_length;
|
size_t vmstate_length;
|
||||||
|
char buf[256];
|
||||||
|
|
||||||
command = "showvminfo \"" + vm_name + "\" ";
|
command = "showvminfo \"" + vm_name + "\" ";
|
||||||
command += "--machinereadable ";
|
command += "--machinereadable ";
|
||||||
|
@ -309,6 +310,13 @@ bool VBOX_VM::is_running() {
|
||||||
vmstate_length = output.find("\"", vmstate_location);
|
vmstate_length = output.find("\"", vmstate_location);
|
||||||
vmstate = output.substr(vmstate_location, vmstate_length);
|
vmstate = output.substr(vmstate_location, vmstate_length);
|
||||||
|
|
||||||
|
fprintf(
|
||||||
|
stderr,
|
||||||
|
"%s Current VM State is '%s'.\n",
|
||||||
|
boinc_msg_prefix(buf, sizeof(buf)),
|
||||||
|
vmstate.c_str()
|
||||||
|
);
|
||||||
|
|
||||||
// VirtualBox Documentation suggests that that a VM is running when its
|
// VirtualBox Documentation suggests that that a VM is running when its
|
||||||
// machine state is between MachineState_FirstOnline and MachineState_LastOnline
|
// machine state is between MachineState_FirstOnline and MachineState_LastOnline
|
||||||
// which as of this writing is 5 and 17.
|
// which as of this writing is 5 and 17.
|
||||||
|
|
Loading…
Reference in New Issue