aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bbot/agent/machine.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/bbot/agent/machine.cxx b/bbot/agent/machine.cxx
index 0431a2f..a8933bb 100644
--- a/bbot/agent/machine.cxx
+++ b/bbot/agent/machine.cxx
@@ -4,7 +4,7 @@
#include <bbot/agent/machine.hxx>
-#include <unistd.h> // sleep()
+#include <unistd.h> // sleep(), usleep()
#include <sys/un.h> // sockaddr_un
#include <sys/socket.h>
@@ -425,6 +425,8 @@ namespace bbot
void kvm_machine::
monitor_command (const string& c)
{
+ tracer trace ("kvm_machine::monitor_command", monitor.string ().c_str ());
+
sockaddr_un addr;
addr.sun_family = AF_LOCAL;
strcpy (addr.sun_path, monitor.string ().c_str ()); // Size check in ctor
@@ -441,7 +443,7 @@ namespace bbot
// Read until we get something.
//
- auto readsome = [&sock] ()
+ auto readsome = [&trace, &sock] ()
{
ifdstream ifs (move (sock),
fdstream_mode::non_blocking,
@@ -456,9 +458,11 @@ namespace bbot
{
n += m;
- //buf[m] = '\0';
- //text << buf;
+ buf[m] = '\0';
+ l5 ([&]{trace << buf;});
}
+
+ usleep (100000); // 0.1s
}
sock = ifs.release ();