From nobody Wed Oct 23 00:25:41 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1729176407; cv=none; d=zohomail.com; s=zohoarc; b=h1lBHOmGJ+CPRQIN6uhMFEhOsZDcO31VN7s8eWiO4l1qz1NDP0pOQpSK0cHfFQ2lqeXQDJw8kln05rPFWR8hRFOBh+bMjOUeIC7myE4GdXd/YKUFGFgtycE2Lxl6YgjtpSUM7RajHgQg4N9uKXr1pZAlAjVacgyami7FrTNMIJc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729176407; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:Message-Id:Reply-To:To; bh=BPum5WuUR1pl6Nf8anLI5uEzQpe4u1JtVxTalO9kwT8=; b=LzaS0rv5wplGkuPokHvFVyCYF5XdvnMN90/XHGNCrrhRZaFUOL+/QnikVKXoMVMnRHEhaIeuo1/8rkZWiblaQEcitjxLPSVKcXfa6kGiUMoIxLf5mpDjDTPmXFElfNv8YMLIV2YDsqTBG6hAnBenPgW/iTCh4izY+5n4cc0CoEk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 172917640784799.63014397229767; Thu, 17 Oct 2024 07:46:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t1Rl7-0003YK-Un; Thu, 17 Oct 2024 10:45:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t1Rl6-0003XZ-4o for qemu-devel@nongnu.org; Thu, 17 Oct 2024 10:45:48 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t1Rl4-0005fe-16 for qemu-devel@nongnu.org; Thu, 17 Oct 2024 10:45:47 -0400 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5c9625cfe4dso1383810a12.0 for ; Thu, 17 Oct 2024 07:45:45 -0700 (PDT) Received: from finn.fritz.box ([2a02:8109:8384:1400:9c4:b066:486:f408]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c98d507a14sm2867581a12.49.2024.10.17.07.45.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2024 07:45:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729176344; x=1729781144; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BPum5WuUR1pl6Nf8anLI5uEzQpe4u1JtVxTalO9kwT8=; b=WTkDgsTzGOOE5aXRHxsZvbBLJdiILT4AX4O2caw8iXWhJzuPguwgLEkxr8GR8xQT7/ XifHGfIlETmmzGK24sR7cDOR6wbILd8r6oNJw6jMrEmidLCbnNh7H6ytfWNbUA3ZitKQ X164H+ZrjK7M7wX05dVtLtbnB+l5B1kpOfeLELXcSxEeDsfGKMPWdbQA6Ehzz1sswpug Aid9NdVo6bfqd9ONRE6m8KrkNbI7xkEvWN7DTaOnxr/isSJqQJHDfHW3HdRReVj/lFVF +4H5VRLpIX7koVzaxdO0qrrhxVePfwNGBZIBiut3rJd3KpILE37qx4KlEgLMVRWHSeJ7 P7Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729176344; x=1729781144; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BPum5WuUR1pl6Nf8anLI5uEzQpe4u1JtVxTalO9kwT8=; b=JtIYk5/mEKOl9Wsh0hZapvTIMPnyEnm5b5FHm0H9/7STqD1nNZG6q31MriyfRgux7e LggUVqiW25Bvjg1pwtt14zo4wtWVZ98VaXHno5YALEuFjVxWjFgybAqmtn0QxAdjIT2a SIdgLlv0UES79xuuMWDEL2TaT+axPWvXrH5v8DSNT4OFrdUEKfJqVQHl4LYacM9zhfAe P+52yV7daG2CLAiI4vUD39RcB/KCE7lKDBdeUjlDTC2+BwcFVQ8q0lmKTWlGpj1tjz1x dFIMxS8qcoGCYzEIaM369clZgTh18a1BLlzp0h/pFF/CcHMaEkc0xUQhWKjy+S3B1upR eutA== X-Forwarded-Encrypted: i=1; AJvYcCV3Dd1Xg6RVutDluVYVqxsLu3VdKodAqcvU9vVDIvo03ScjaaQ7tZc6JjjkIluXehaJSSQd5g9MHPRg@nongnu.org X-Gm-Message-State: AOJu0YxXwF+rQxB62LrRZFvjE7PyszvkwieUhtHInuQF7mhsQzZGrq4D USPAxwwj3lnrd034IL28Amy0TEt6GKjzAfremQHwol0yzc1BNufV X-Google-Smtp-Source: AGHT+IFB7wPcnERiA5LRenZDfsxhw2O3PPrNeBoEPL1806/I5t6mCc+tmrXj3qhmVbSaVrHOPDgSVQ== X-Received: by 2002:a05:6402:1e93:b0:5c9:845f:25fd with SMTP id 4fb4d7f45d1cf-5c9845f2752mr10802859a12.23.1729176344220; Thu, 17 Oct 2024 07:45:44 -0700 (PDT) From: Roman Penyaev To: Cc: Roman Penyaev , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-devel@nongnu.org Subject: [PATCH v5 8/8] qemu-options.hx: describe multiplexing of several backend devices Date: Thu, 17 Oct 2024 16:43:16 +0200 Message-Id: <20241017144316.517709-9-r.peniaev@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241017144316.517709-1-r.peniaev@gmail.com> References: <20241017144316.517709-1-r.peniaev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=r.peniaev@gmail.com; helo=mail-ed1-x533.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1729176408505116600 This adds a few lines describing `mux-be` multiplexer configuration for multiplexing several backend devices with a single frontend device. Signed-off-by: Roman Penyaev Cc: "Marc-Andr=C3=A9 Lureau" Cc: qemu-devel@nongnu.org --- qemu-options.hx | 80 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 60 insertions(+), 20 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index daae49414740..d620dc39b489 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -3677,37 +3677,37 @@ DEFHEADING(Character device options:) =20 DEF("chardev", HAS_ARG, QEMU_OPTION_chardev, "-chardev help\n" - "-chardev null,id=3Did[,mux=3Don|off][,logfile=3DPATH][,logappend=3Don= |off]\n" + "-chardev null,id=3Did[,mux=3Don|off][,mux-be-id=3Did][,logfile=3DPATH= ][,logappend=3Don|off]\n" "-chardev socket,id=3Did[,host=3Dhost],port=3Dport[,to=3Dto][,ipv4=3Do= n|off][,ipv6=3Don|off][,nodelay=3Don|off]\n" - " [,server=3Don|off][,wait=3Don|off][,telnet=3Don|off][,websoc= ket=3Don|off][,reconnect=3Dseconds][,mux=3Don|off]\n" + " [,server=3Don|off][,wait=3Don|off][,telnet=3Don|off][,websoc= ket=3Don|off][,reconnect=3Dseconds][,mux=3Don|off][,mux-be-id=3Did]\n" " [,logfile=3DPATH][,logappend=3Don|off][,tls-creds=3DID][,tls= -authz=3DID] (tcp)\n" "-chardev socket,id=3Did,path=3Dpath[,server=3Don|off][,wait=3Don|off]= [,telnet=3Don|off][,websocket=3Don|off][,reconnect=3Dseconds]\n" - " [,mux=3Don|off][,logfile=3DPATH][,logappend=3Don|off][,abstr= act=3Don|off][,tight=3Don|off] (unix)\n" + " [,mux=3Don|off][,mux-be-id=3Did][,logfile=3DPATH][,logappend= =3Don|off][,abstract=3Don|off][,tight=3Don|off] (unix)\n" "-chardev udp,id=3Did[,host=3Dhost],port=3Dport[,localaddr=3Dlocaladdr= ]\n" - " [,localport=3Dlocalport][,ipv4=3Don|off][,ipv6=3Don|off][,mu= x=3Don|off]\n" + " [,localport=3Dlocalport][,ipv4=3Don|off][,ipv6=3Don|off][,mu= x=3Don|off][,mux-be-id=3Did]\n" " [,logfile=3DPATH][,logappend=3Don|off]\n" - "-chardev msmouse,id=3Did[,mux=3Don|off][,logfile=3DPATH][,logappend= =3Don|off]\n" + "-chardev msmouse,id=3Did[,mux=3Don|off][,mux-be-id=3Did][,logfile=3DP= ATH][,logappend=3Don|off]\n" "-chardev vc,id=3Did[[,width=3Dwidth][,height=3Dheight]][[,cols=3Dcols= ][,rows=3Drows]]\n" - " [,mux=3Don|off][,logfile=3DPATH][,logappend=3Don|off]\n" + " [,mux=3Don|off][,mux-be-id=3Did][,logfile=3DPATH][,logappend= =3Don|off]\n" "-chardev ringbuf,id=3Did[,size=3Dsize][,logfile=3DPATH][,logappend=3D= on|off]\n" - "-chardev file,id=3Did,path=3Dpath[,input-path=3Dinput-file][,mux=3Don= |off][,logfile=3DPATH][,logappend=3Don|off]\n" - "-chardev pipe,id=3Did,path=3Dpath[,mux=3Don|off][,logfile=3DPATH][,lo= gappend=3Don|off]\n" + "-chardev file,id=3Did,path=3Dpath[,input-path=3Dinput-file][,mux=3Don= |off][,mux-be-id=3Did][,logfile=3DPATH][,logappend=3Don|off]\n" + "-chardev pipe,id=3Did,path=3Dpath[,mux=3Don|off][,mux-be-id=3Did][,lo= gfile=3DPATH][,logappend=3Don|off]\n" #ifdef _WIN32 - "-chardev console,id=3Did[,mux=3Don|off][,logfile=3DPATH][,logappend= =3Don|off]\n" - "-chardev serial,id=3Did,path=3Dpath[,mux=3Don|off][,logfile=3DPATH][,= logappend=3Don|off]\n" + "-chardev console,id=3Did[,mux=3Don|off][,mux-be-id=3Did][,logfile=3DP= ATH][,logappend=3Don|off]\n" + "-chardev serial,id=3Did,path=3Dpath[,mux=3Don|off][,mux-be-id=3Did][,= logfile=3DPATH][,logappend=3Don|off]\n" #else - "-chardev pty,id=3Did[,path=3Dpath][,mux=3Don|off][,logfile=3DPATH][,l= ogappend=3Don|off]\n" - "-chardev stdio,id=3Did[,mux=3Don|off][,signal=3Don|off][,logfile=3DPA= TH][,logappend=3Don|off]\n" + "-chardev pty,id=3Did[,path=3Dpath][,mux=3Don|off][,mux-be-id=3Did][,l= ogfile=3DPATH][,logappend=3Don|off]\n" + "-chardev stdio,id=3Did[,mux=3Don|off][,mux-be-id=3Did][,signal=3Don|o= ff][,logfile=3DPATH][,logappend=3Don|off]\n" #endif #ifdef CONFIG_BRLAPI - "-chardev braille,id=3Did[,mux=3Don|off][,logfile=3DPATH][,logappend= =3Don|off]\n" + "-chardev braille,id=3Did[,mux=3Don|off][,mux-be-id=3Did][,logfile=3DP= ATH][,logappend=3Don|off]\n" #endif #if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \ || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__Dragon= Fly__) - "-chardev serial,id=3Did,path=3Dpath[,mux=3Don|off][,logfile=3DPATH][,= logappend=3Don|off]\n" + "-chardev serial,id=3Did,path=3Dpath[,mux=3Don|off][,mux-be-id=3Did][,= logfile=3DPATH][,logappend=3Don|off]\n" #endif #if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) - "-chardev parallel,id=3Did,path=3Dpath[,mux=3Don|off][,logfile=3DPATH]= [,logappend=3Don|off]\n" + "-chardev parallel,id=3Did,path=3Dpath[,mux=3Don|off][,mux-be-id=3Did]= [,logfile=3DPATH][,logappend=3Don|off]\n" #endif #if defined(CONFIG_SPICE) "-chardev spicevmc,id=3Did,name=3Dname[,debug=3Ddebug][,logfile=3DPATH= ][,logappend=3Don|off]\n" @@ -3719,8 +3719,8 @@ DEF("chardev", HAS_ARG, QEMU_OPTION_chardev, SRST The general form of a character device option is: =20 -``-chardev backend,id=3Did[,mux=3Don|off][,options]`` - Backend is one of: ``null``, ``socket``, ``udp``, ``msmouse``, +``-chardev backend,id=3Did[,mux=3Don|off][,mux-be-id=3Did][,options]`` + Backend is one of: ``null``, ``socket``, ``udp``, ``msmouse``, ``mux-b= e``, ``vc``, ``ringbuf``, ``file``, ``pipe``, ``console``, ``serial``, ``pty``, ``stdio``, ``braille``, ``parallel``, ``spicevmc``, ``spiceport``. The specific backend will determine the @@ -3777,9 +3777,11 @@ The general form of a character device option is: the QEMU monitor, and ``-nographic`` also multiplexes the console and the monitor to stdio. =20 - There is currently no support for multiplexing in the other - direction (where a single QEMU front end takes input and output from - multiple chardevs). + If you need to multiplex in the opposite direction (where one QEMU + interface receives input and output from multiple chardev devices), + each character device needs the ``mux-be-id=3DID`` option. Please + refer to the paragraph below regarding chardev ``mux-be`` + configuration. =20 Every backend supports the ``logfile`` option, which supplies the path to a file to record all data transmitted via the backend. The @@ -3879,6 +3881,44 @@ The available backends are: Forward QEMU's emulated msmouse events to the guest. ``msmouse`` does not take any options. =20 +``-chardev mux-be,id=3Did`` + Explicitly create chardev backend multiplexer with the possibility + to multiplex in the opposite direction, where one QEMU interface + (frontend device) receives input and output from multiple chardev + backend devices. (Since 9.2) + + For example, the following is a use case of 2 backend devices: + virtual console ``vc0`` and a socket ``sock0`` connected to a + single virtio hvc console frontend device with multiplexer + ``mux0`` help. Virtual console renders text to an image, which can + be shared over the VNC protocol. In turn, socket backend provides + bidirectional communication to the virtio hvc console over the + socket. The example configuration can be as follows: + + :: + + -chardev mux-be,id=3Dmux0 \ + -chardev socket,path=3D/tmp/sock,server=3Don,wait=3Doff,id=3Dsock0,= mux-be-id=3Dmux0 \ + -chardev vc,id=3Dvc0,mux-be-id=3Dmux0 \ + -device virtconsole,chardev=3Dmux0 \ + -vnc 0.0.0.0:0 + + Once QEMU starts VNC client and any TTY emulator can be used to + control a single hvc console: + + :: + + # VNC client + vncviewer :0 + + # TTY emulator + socat unix-connect:/tmp/sock pty,link=3D/tmp/pty & \ + tio /tmp/pty + + Multiplexing of several backend devices with several frontend + devices is not supported. Stacking of multiplexers is not + supported as well. + ``-chardev vc,id=3Did[[,width=3Dwidth][,height=3Dheight]][[,cols=3Dcols][,= rows=3Drows]]`` Connect to a QEMU text console. ``vc`` may optionally be given a specific size. --=20 2.34.1