From 7bd9beb8125a3a2b1c4ee137b3fb22ae87f5726b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 25 Jun 2018 09:31:19 +0200 Subject: Set QEMU_AUDIO_DRV to 'none' to disable audio output --- bbot/agent/machine.cxx | 5 +++-- bbot/utility.hxx | 6 +++--- bbot/utility.txx | 11 ++++------- 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 + template process run_io_start (tracer&, I&& in, O&& out, E&& err, - const dir_path& cwd, - const P&, + const process_env&, A&&...); template 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 + template 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 (in), forward (out), forward (err), - butl::process_env (p, cwd), + pe, forward (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 (in), forward (out), forward (err), - dir_path (), p, forward (args)...)); @@ -93,7 +91,6 @@ namespace bbot forward (in), forward (out), forward (err), - dir_path (), p, forward (args)...)); run_io_finish (t, pr, p); -- cgit v1.1