From patchwork Tue Feb 16 16:03:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 8328821 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 357589F399 for ; Tue, 16 Feb 2016 16:03:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8F355202E6 for ; Tue, 16 Feb 2016 16:03:17 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3956B202FF for ; Tue, 16 Feb 2016 16:03:16 +0000 (UTC) Received: from localhost ([::1]:47381 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVi5r-0005fF-DK for patchwork-qemu-devel@patchwork.kernel.org; Tue, 16 Feb 2016 11:03:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVi5k-0005ey-Hw for qemu-devel@nongnu.org; Tue, 16 Feb 2016 11:03:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVi5g-0006th-0F for qemu-devel@nongnu.org; Tue, 16 Feb 2016 11:03:08 -0500 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:57386) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVi5f-0006tJ-Pf for qemu-devel@nongnu.org; Tue, 16 Feb 2016 11:03:03 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.84) (envelope-from ) id 1aVi5d-0001Xu-5X; Tue, 16 Feb 2016 16:03:01 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Tue, 16 Feb 2016 16:03:01 +0000 Message-Id: <1455638581-5912-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.1.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::1 Cc: qemu-trivial@nongnu.org, Paolo Bonzini , Stefan Hajnoczi , patches@linaro.org Subject: [Qemu-devel] [PATCH] qemu-options.hx: Improve documentation of chardev multiplexing mode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Eric Blake Reviewed-by: Kashyap Chamarthy --- 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}