diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-01-21 13:14:19 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-01-21 13:14:19 +0200 |
commit | 5662e66dcdbf1af13b4ccf7352f3e435c1baf597 (patch) | |
tree | 9061f17ed5f7edc91d0d30b10aaa1c0eda2d63cf /bbot/agent/machine.cxx | |
parent | 432bc29a5c4b24b24e5c33feb34d38153978b718 (diff) |
Add support for running multiple instances of agent for same toolchain
This allows us to perform multiple bootstraps/builds in parallel. Note
that each machine can only be used by a single instance so it doesn't
make sense to have more instances than machines.
Diffstat (limited to 'bbot/agent/machine.cxx')
-rw-r--r-- | bbot/agent/machine.cxx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/bbot/agent/machine.cxx b/bbot/agent/machine.cxx index 25b5278..df23fde 100644 --- a/bbot/agent/machine.cxx +++ b/bbot/agent/machine.cxx @@ -84,7 +84,7 @@ namespace bbot static string create_tap (const string& br, uint16_t port) { - string t ("tap" + to_string (tc_num)); + string t ("tap" + to_string (offset)); tracer trace ("create_tap", t.c_str ()); @@ -207,8 +207,13 @@ namespace bbot generate_mac ()), kvm ("kvm"), net (br, port), - vnc ("127.0.0.1:" + to_string (5900 + tc_num)), - monitor ("/tmp/" + tc_name + "-monitor") + // + // QEMU's -vnc option (see below) expects the port offset from 5900 + // rather than the absolute value. The low 5901+, 6001+, and 6101+ + // ports all look good collision-wise with anything useful. + // + vnc ("127.0.0.1:" + to_string (5900 + offset)), + monitor ("/tmp/monitor-" + tc_name + '-' + to_string (inst)) { tracer trace ("kvm_machine", md.string ().c_str ()); @@ -324,7 +329,7 @@ namespace bbot "-no-hpet", "-global", "kvm-pit.lost_tick_policy=discard", os, - "-vnc", "127.0.0.1:" + to_string (tc_num), // 5900 + tc_num + "-vnc", "127.0.0.1:" + to_string (offset), // 5900 + offset "-monitor", "unix:" + monitor.string () + ",server,nowait"); } |