From 5662e66dcdbf1af13b4ccf7352f3e435c1baf597 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 21 Jan 2019 13:14:19 +0200 Subject: 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. --- bbot/agent/machine.cxx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'bbot/agent/machine.cxx') 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"); } -- cgit v1.1