From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aViYC-0007Jy-UK for qemu-devel@nongnu.org; Tue, 16 Feb 2016 11:32:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aViY7-0006cu-34 for qemu-devel@nongnu.org; Tue, 16 Feb 2016 11:32:32 -0500 References: <1455638581-5912-1-git-send-email-peter.maydell@linaro.org> From: Laszlo Ersek Message-ID: <56C34F18.7090006@redhat.com> Date: Tue, 16 Feb 2016 17:32:24 +0100 MIME-Version: 1.0 In-Reply-To: <1455638581-5912-1-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] qemu-options.hx: Improve documentation of chardev multiplexing mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Paolo Bonzini , Stefan Hajnoczi , patches@linaro.org On 02/16/16 17:03, Peter Maydell wrote: > The current documentation of chardev mux=on is rather brief and opaque; > expand it to hopefully be a bit more helpful. > > Signed-off-by: Peter Maydell > --- > There was some discussion on #qemu yesterday evening about multiplexing, > and "make the docs a bit less confusing" was one suggestion... > --- > qemu-options.hx | 20 +++++++++++++++++++- > 1 file changed, 19 insertions(+), 1 deletion(-) > > diff --git a/qemu-options.hx b/qemu-options.hx > index 2f0465e..6b46dd4 100644 > --- a/qemu-options.hx > +++ b/qemu-options.hx > @@ -2162,8 +2162,26 @@ All devices must have an id, which can be any string up to 127 characters long. > It is used to uniquely identify this device in other command line directives. > > A character device may be used in multiplexing mode by multiple front-ends. > +Specify @option{mux=on} to enable this mode. > +A multiplexer is a "1:N" device, and here the "1" end is your specified chardev > +backend, and the "N" end is the various parts of QEMU that can talk to a chardev. > +If you create a chardev with @option{id=myid} and @option{mux=on}, QEMU will > +create a multiplexer with your specified ID, and you can then configure multiple > +front ends to use that chardev ID for their input/output. Up to four different > +front ends can be connected to a single multiplexed chardev. (Without > +multiplexing enabled, a chardev can only be used by a single front end.) > +For instance you could use this to allow a single stdio chardev to be used by > +two serial ports and the QEMU monitor. > + > The key sequence of @key{Control-a} and @key{c} will rotate the input focus > -between attached front-ends. Specify @option{mux=on} to enable this mode. > +of a multiplexed character device between attached front-ends. > + > +You can have more than one multiplexer in a system configuration; for instance > +you could have a TCP port multiplexed between UART 0 and UART 1, and stdio > +multiplexed between the QEMU monitor and a parallel port. > + > +There is currently no support for multiplexing in the other direction > +(where a single QEMU front end takes input and output from multiple chardevs). > > Every backend supports the @option{logfile} option, which supplies the path > to a file to record all data transmitted via the backend. The @option{logappend} > I'm a big fan of muxing the stdio backend between the (human) monitor and the guest's serial console: -chardev stdio,signal=off,mux=on,id=char0 \ -mon chardev=char0,mode=readline,default \ -serial chardev:char0 \ I think if you could mention the following in the above, that would be even more helpful: - how to enter a real Control-A character (relevant when typing at the guest's shell prompt, over serial) - not strictly related, but a warning about using this in "screen" (I use "screen" all the time to capture serial IO) -- Control-A is also piggy-backed by "screen" - how the initially active frontend gets selected - the fact that frontends use different syntaxes to refer to the backend. You have two examples in the text being added ("for instance, ..."), so I think it would be really helpful to provide actual command line options for those. Just my two cents. The patch looks great. Thanks Laszlo