diff options
-rw-r--r-- | bbot/machine.cxx | 22 | ||||
-rw-r--r-- | doc/manual.cli | 6 |
2 files changed, 25 insertions, 3 deletions
diff --git a/bbot/machine.cxx b/bbot/machine.cxx index de394b6..0bd2e86 100644 --- a/bbot/machine.cxx +++ b/bbot/machine.cxx @@ -205,7 +205,29 @@ namespace bbot strings os; if (mm.options) + { os = mm.unquoted_options (); + + // Pre-process ifname=? and mac=?. + // + auto sub = [] (string& o, const char* s, const string& r) + { + size_t p (o.find (s)); + + if (p != string::npos) + { + p = o.find ('?', p + 1); + assert (p != string::npos); + o.replace (p, 1, r); + } + }; + + for (string& o: os) + { + sub (o, "ifname=?", tap); + sub (o, "mac=?", mac); + } + } else { auto add = [&os] (string o, string v) diff --git a/doc/manual.cli b/doc/manual.cli index a851008..f26f350 100644 --- a/doc/manual.cli +++ b/doc/manual.cli @@ -244,9 +244,9 @@ the header values must appear before any non-header values. For \c{kvm} machines, if this value is present, then it replaces the default network and disk configuration when starting the QEMU/KVM - hypervisor. - -|| + hypervisor The options are pre-processed by replacing the question + mark in \c{ifname=?} and \c{mac=?} strings with the network interface + and MAC address, respectively.|| \h#arch-task-manifest|Task Manifest| |