mirror of https://github.com/BOINC/boinc.git
VBOX: Only attempt to take a screen shot if VirtualBox is greater than 5.0 (VboxManage Interface)
This commit is contained in:
parent
fe7f919519
commit
7d0b8a59ad
|
@ -1162,26 +1162,29 @@ int VBOX_VM::resume() {
|
|||
}
|
||||
|
||||
int VBOX_VM::capture_screenshot() {
|
||||
string command;
|
||||
string output;
|
||||
string virtual_machine_slot_directory;
|
||||
int retval = BOINC_SUCCESS;
|
||||
if (is_virtualbox_version_newer(5, 0, 0)) {
|
||||
|
||||
get_slot_directory(virtual_machine_slot_directory);
|
||||
string command;
|
||||
string output;
|
||||
string virtual_machine_slot_directory;
|
||||
int retval = BOINC_SUCCESS;
|
||||
|
||||
vboxlog_msg("Capturing screenshot.");
|
||||
get_slot_directory(virtual_machine_slot_directory);
|
||||
|
||||
command = "controlvm \"" + vm_name + "\" ";
|
||||
command += "screenshotpng \"";
|
||||
command += virtual_machine_slot_directory;
|
||||
command += "/";
|
||||
command += SCREENSHOT_FILENAME;
|
||||
command += "\"";
|
||||
retval = vbm_popen(command, output, "capture screenshot", true, true, 0);
|
||||
if (retval) return retval;
|
||||
vboxlog_msg("Capturing screenshot.");
|
||||
|
||||
vboxlog_msg("Screenshot completed.");
|
||||
|
||||
command = "controlvm \"" + vm_name + "\" ";
|
||||
command += "screenshotpng \"";
|
||||
command += virtual_machine_slot_directory;
|
||||
command += "/";
|
||||
command += SCREENSHOT_FILENAME;
|
||||
command += "\"";
|
||||
retval = vbm_popen(command, output, "capture screenshot", true, true, 0);
|
||||
if (retval) return retval;
|
||||
|
||||
vboxlog_msg("Screenshot completed.");
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue