From 6cfdbf88f12b6b9c1bfd234a71534c41a7ef0310 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Wed, 22 Jan 2014 14:34:20 -0500 Subject: [PATCH] VBOX: Introducing the replay and trace logs for vboxwrapper. The replay log stores the commands that were executed in a near shell script state. Ideally we should be able to use this to pass bugs back upstream to VirtualBox. The trace log shows the date, time, thread id, command, return value, and output of the above commands. --- samples/vboxwrapper/vbox.cpp | 78 ++++++++++++++++++++++++++---------- samples/vboxwrapper/vbox.h | 14 ++++++- 2 files changed, 69 insertions(+), 23 deletions(-) diff --git a/samples/vboxwrapper/vbox.cpp b/samples/vboxwrapper/vbox.cpp index 984cffc748..85a41d412c 100644 --- a/samples/vboxwrapper/vbox.cpp +++ b/samples/vboxwrapper/vbox.cpp @@ -276,7 +276,7 @@ void VBOX_VM::poll(bool log_state) { command = "showvminfo \"" + vm_name + "\" "; command += "--machinereadable "; - if (vbm_popen(command, output, "VM state", false, false) == 0) { + if (vbm_popen(command, output, "VM state", false, false, 45, false) == 0) { vmstate_start = output.find("VMState=\""); if (vmstate_start != string::npos) { vmstate_start += 9; @@ -2291,6 +2291,7 @@ int VBOX_VM::launch_vboxsvc() { ); } + vbm_trace(command, std::string(""), retval); } } } @@ -2303,9 +2304,11 @@ int VBOX_VM::launch_vboxsvc() { int VBOX_VM::launch_vboxvm() { char buf[256]; char error_msg[256]; - int retval = ERR_EXEC; + char cmdline[1024]; char* argv[5]; int argc; + std::string output; + int retval = ERR_EXEC; // Construct the command line parameters // @@ -2324,8 +2327,15 @@ int VBOX_VM::launch_vboxvm() { argv[4] = NULL; argc = 4; + strcpy(cmdline, ""); + for (int i=0; i