aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-06-25 09:31:19 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-06-25 09:31:19 +0200
commit7bd9beb8125a3a2b1c4ee137b3fb22ae87f5726b (patch)
tree6c509ada10a935f747f660eff90b372965a666ed
parent90b1fc64ec00b974010a2218a6b80554648dc75c (diff)
Set QEMU_AUDIO_DRV to 'none' to disable audio output
-rw-r--r--bbot/agent/machine.cxx5
-rw-r--r--bbot/utility.hxx6
-rw-r--r--bbot/utility.txx11
3 files changed, 10 insertions, 12 deletions
diff --git a/bbot/agent/machine.cxx b/bbot/agent/machine.cxx
index a8933bb..a1fe9bb 100644
--- a/bbot/agent/machine.cxx
+++ b/bbot/agent/machine.cxx
@@ -296,13 +296,14 @@ namespace bbot
//
// 1. echo system_powerdown | socat - UNIX-CONNECT:.../monitor
//
+ const char* env[] = {"QEMU_AUDIO_DRV=none", // Disable audio output.
+ nullptr};
proc = run_io_start (
trace,
fdnull (),
2,
2,
- md, // Run from the machine's directory.
- kvm,
+ process_env (kvm, md, env), // Run from the machine's directory.
"-boot", "c", // Boot from disk.
"-no-reboot", // Exit on VM reboot.
"-m", to_string (ram / 1024) + "M",
diff --git a/bbot/utility.hxx b/bbot/utility.hxx
index ee74816..c9cd95d 100644
--- a/bbot/utility.hxx
+++ b/bbot/utility.hxx
@@ -61,6 +61,7 @@ namespace bbot
class tracer;
using butl::process;
+ using butl::process_env;
using butl::process_exit;
using butl::process_error;
@@ -72,14 +73,13 @@ namespace bbot
process_exit::code_type
run_io_exit (tracer&, I&& in, O&& out, E&& err, const P&, A&&...);
- template <typename I, typename O, typename E, typename P, typename... A>
+ template <typename I, typename O, typename E, typename... A>
process
run_io_start (tracer&,
I&& in,
O&& out,
E&& err,
- const dir_path& cwd,
- const P&,
+ const process_env&,
A&&...);
template <typename P>
diff --git a/bbot/utility.txx b/bbot/utility.txx
index b3d6d53..43d995a 100644
--- a/bbot/utility.txx
+++ b/bbot/utility.txx
@@ -15,14 +15,13 @@ namespace bbot
{
// run_*()
//
- template <typename I, typename O, typename E, typename P, typename... A>
+ template <typename I, typename O, typename E, typename... A>
process
run_io_start (tracer& t,
I&& in,
O&& out,
E&& err,
- const dir_path& cwd,
- const P& p,
+ const process_env& pe,
A&&... args)
{
try
@@ -32,12 +31,12 @@ namespace bbot
forward<I> (in),
forward<O> (out),
forward<E> (err),
- butl::process_env (p, cwd),
+ pe,
forward<A> (args)...);
}
catch (const process_error& e)
{
- fail << "unable to execute " << p << ": " << e << endf;
+ fail << "unable to execute " << *pe.path << ": " << e << endf;
}
}
@@ -78,7 +77,6 @@ namespace bbot
forward<I> (in),
forward<O> (out),
forward<E> (err),
- dir_path (),
p,
forward<A> (args)...));
@@ -93,7 +91,6 @@ namespace bbot
forward<I> (in),
forward<O> (out),
forward<E> (err),
- dir_path (),
p,
forward<A> (args)...));
run_io_finish (t, pr, p);