aboutsummaryrefslogtreecommitdiff
path: root/bbot/agent/machine.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'bbot/agent/machine.cxx')
-rw-r--r--bbot/agent/machine.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/bbot/agent/machine.cxx b/bbot/agent/machine.cxx
index 8308989..16f0525 100644
--- a/bbot/agent/machine.cxx
+++ b/bbot/agent/machine.cxx
@@ -172,7 +172,8 @@ namespace bbot
const optional<string>& mac,
const string& br_iface,
uint16_t tftp_port,
- bool pub_vnc);
+ bool pub_vnc,
+ optional<size_t> boost_cpus = nullopt);
virtual bool
shutdown (size_t& seconds) override;
@@ -216,7 +217,8 @@ namespace bbot
const optional<string>& omac,
const string& br,
uint16_t port,
- bool pub_vnc)
+ bool pub_vnc,
+ optional<size_t> bcpus)
: machine (mm.mac ? *mm.mac : // Fixed mac from machine manifest.
omac ? *omac : // Generated mac from previous bootstrap.
generate_mac ()),
@@ -249,7 +251,7 @@ namespace bbot
// Note that for best results you may want to adjust (e.g., by over-
// committing) the number of CPUs to be power of 2.
//
- size_t cpus (ops.cpu ()), cores (cpus);
+ size_t cpus (bcpus ? *bcpus : ops.cpu ()), cores (cpus);
size_t sockets (cores >= 16 && cores % 4 == 0 ? 2 :
cores >= 64 && cores % 8 == 0 ? 4 : 1);
@@ -672,13 +674,14 @@ namespace bbot
const optional<string>& mac,
const string& br_iface,
uint16_t tftp_port,
- bool pub_vnc)
+ bool pub_vnc,
+ optional<size_t> bcpus)
{
switch (mm.type)
{
case machine_type::kvm:
return make_unique<kvm_machine> (
- md, mm, mac, br_iface, tftp_port, pub_vnc);
+ md, mm, mac, br_iface, tftp_port, pub_vnc, bcpus);
case machine_type::nspawn:
assert (false); //@@ TODO