From 7d0b8a59ade88745b9b6a5235658b80f83a262a3 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Wed, 15 Jun 2016 22:29:59 -0700 Subject: [PATCH] VBOX: Only attempt to take a screen shot if VirtualBox is greater than 5.0 (VboxManage Interface) --- samples/vboxwrapper/vbox_vboxmanage.cpp | 35 ++++++++++++++----------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/samples/vboxwrapper/vbox_vboxmanage.cpp b/samples/vboxwrapper/vbox_vboxmanage.cpp index a6eae8fad9..760adccbbe 100644 --- a/samples/vboxwrapper/vbox_vboxmanage.cpp +++ b/samples/vboxwrapper/vbox_vboxmanage.cpp @@ -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; }