From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: Roman Penyaev <r.peniaev@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH v4 8/8] qemu-options.hx: describe multiplexing of several backend devices
Date: Wed, 16 Oct 2024 15:27:59 +0400 [thread overview]
Message-ID: <CAMxuvayHTYDsXAp=8pwixa15g+oDWC-CSGYhg=RB5RpWdtB0_w@mail.gmail.com> (raw)
In-Reply-To: <20241016102605.459395-9-r.peniaev@gmail.com>
Hi
On Wed, Oct 16, 2024 at 2:28 PM Roman Penyaev <r.peniaev@gmail.com> wrote:
>
> 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 <r.peniaev@gmail.com>
> Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>
> Cc: qemu-devel@nongnu.org
> ---
> qemu-options.hx | 78 ++++++++++++++++++++++++++++++++++++-------------
> 1 file changed, 58 insertions(+), 20 deletions(-)
>
> diff --git a/qemu-options.hx b/qemu-options.hx
> index daae49414740..dd5dfe8596f0 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -3677,37 +3677,37 @@ DEFHEADING(Character device options:)
>
> DEF("chardev", HAS_ARG, QEMU_OPTION_chardev,
> "-chardev help\n"
> - "-chardev null,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
> + "-chardev null,id=id[,mux=on|off][,mux-be-id=id][,logfile=PATH][,logappend=on|off]\n"
> "-chardev socket,id=id[,host=host],port=port[,to=to][,ipv4=on|off][,ipv6=on|off][,nodelay=on|off]\n"
> - " [,server=on|off][,wait=on|off][,telnet=on|off][,websocket=on|off][,reconnect=seconds][,mux=on|off]\n"
> + " [,server=on|off][,wait=on|off][,telnet=on|off][,websocket=on|off][,reconnect=seconds][,mux=on|off][,mux-be-id=id]\n"
> " [,logfile=PATH][,logappend=on|off][,tls-creds=ID][,tls-authz=ID] (tcp)\n"
> "-chardev socket,id=id,path=path[,server=on|off][,wait=on|off][,telnet=on|off][,websocket=on|off][,reconnect=seconds]\n"
> - " [,mux=on|off][,logfile=PATH][,logappend=on|off][,abstract=on|off][,tight=on|off] (unix)\n"
> + " [,mux=on|off][,mux-be-id=id][,logfile=PATH][,logappend=on|off][,abstract=on|off][,tight=on|off] (unix)\n"
> "-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr]\n"
> - " [,localport=localport][,ipv4=on|off][,ipv6=on|off][,mux=on|off]\n"
> + " [,localport=localport][,ipv4=on|off][,ipv6=on|off][,mux=on|off][,mux-be-id=id]\n"
> " [,logfile=PATH][,logappend=on|off]\n"
> - "-chardev msmouse,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
> + "-chardev msmouse,id=id[,mux=on|off][,mux-be-id=id][,logfile=PATH][,logappend=on|off]\n"
> "-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]\n"
> - " [,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
> + " [,mux=on|off][,mux-be-id=id][,logfile=PATH][,logappend=on|off]\n"
> "-chardev ringbuf,id=id[,size=size][,logfile=PATH][,logappend=on|off]\n"
> - "-chardev file,id=id,path=path[,input-path=input-file][,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
> - "-chardev pipe,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
> + "-chardev file,id=id,path=path[,input-path=input-file][,mux=on|off][,mux-be-id=id][,logfile=PATH][,logappend=on|off]\n"
> + "-chardev pipe,id=id,path=path[,mux=on|off][,mux-be-id=id][,logfile=PATH][,logappend=on|off]\n"
> #ifdef _WIN32
> - "-chardev console,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
> - "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
> + "-chardev console,id=id[,mux=on|off][,mux-be-id=id][,logfile=PATH][,logappend=on|off]\n"
> + "-chardev serial,id=id,path=path[,mux=on|off][,mux-be-id=id][,logfile=PATH][,logappend=on|off]\n"
> #else
> - "-chardev pty,id=id[,path=path][,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
> - "-chardev stdio,id=id[,mux=on|off][,signal=on|off][,logfile=PATH][,logappend=on|off]\n"
> + "-chardev pty,id=id[,path=path][,mux=on|off][,mux-be-id=id][,logfile=PATH][,logappend=on|off]\n"
> + "-chardev stdio,id=id[,mux=on|off][,mux-be-id=id][,signal=on|off][,logfile=PATH][,logappend=on|off]\n"
> #endif
> #ifdef CONFIG_BRLAPI
> - "-chardev braille,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
> + "-chardev braille,id=id[,mux=on|off][,mux-be-id=id][,logfile=PATH][,logappend=on|off]\n"
> #endif
> #if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
> || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
> - "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
> + "-chardev serial,id=id,path=path[,mux=on|off][,mux-be-id=id][,logfile=PATH][,logappend=on|off]\n"
> #endif
> #if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__)
> - "-chardev parallel,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
> + "-chardev parallel,id=id,path=path[,mux=on|off][,mux-be-id=id][,logfile=PATH][,logappend=on|off]\n"
> #endif
> #if defined(CONFIG_SPICE)
> "-chardev spicevmc,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n"
> @@ -3719,8 +3719,8 @@ DEF("chardev", HAS_ARG, QEMU_OPTION_chardev,
> SRST
> The general form of a character device option is:
>
> -``-chardev backend,id=id[,mux=on|off][,options]``
> - Backend is one of: ``null``, ``socket``, ``udp``, ``msmouse``,
> +``-chardev backend,id=id[,mux=on|off][,mux-be-id=id][,options]``
> + Backend is one of: ``null``, ``socket``, ``udp``, ``msmouse``, ``mux-be``,
> ``vc``, ``ringbuf``, ``file``, ``pipe``, ``console``, ``serial``,
> ``pty``, ``stdio``, ``braille``, ``parallel``,
> ``spicevmc``, ``spiceport``. The specific backend will determine the
> @@ -3777,9 +3777,10 @@ The general form of a character device option is:
> the QEMU monitor, and ``-nographic`` also multiplexes the console
> and the monitor to stdio.
>
> - 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 ``mux-be-id=id`` option. Please refer
> + to the paragraph below regarding chardev ``mux-be`` configuration.
>
> Every backend supports the ``logfile`` option, which supplies the
> path to a file to record all data transmitted via the backend. The
> @@ -3879,6 +3880,43 @@ The available backends are:
> Forward QEMU's emulated msmouse events to the guest. ``msmouse``
> does not take any options.
>
> +``-chardev mux-be,id=id``
> + Explicitly create chardev backend multiplexer with possibility to
> + multiplex in the opposite direction, where one QEMU interface
> + (frontend device) receives input and output from multiple chardev
> + backend devices.
We are not very good at documenting the version, but you could add (Since 9.2)
> +
> + For example the following is a use case of 2 backend devices: text
> + 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
> + biderectional communication to the virtio hvc console over socket.
bidirectional
> + The example configuration can be the following:
> +
> + ::
> +
> + -chardev mux-be,id=mux0 \
> + -chardev socket,path=/tmp/sock,server=on,wait=off,id=sock0,mux-be-id=mux0 \
> + -chardev vc,id=vc0,mux-be-id=mux0 \
> + -device virtconsole,chardev=mux0 \
> + -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=/tmp/pty & \
> + tio /tmp/pty
> +
> + Multiplexing of several backend devices with serveral frontend devices
several
> + is not supported.
> +
> ``-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]``
> Connect to a QEMU text console. ``vc`` may optionally be given a
> specific size.
> --
> 2.34.1
>
prev parent reply other threads:[~2024-10-16 11:29 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-16 10:25 [PATCH v4 0/8] chardev: implement backend chardev multiplexing Roman Penyaev
2024-10-16 10:25 ` [PATCH v4 1/8] chardev/char: rename `MuxChardev` struct to `MuxFeChardev` Roman Penyaev
2024-10-16 10:25 ` [PATCH v4 2/8] chardev/char: rename `char-mux.c` to `char-mux-fe.c` Roman Penyaev
2024-10-16 10:26 ` [PATCH v4 3/8] chardev/char: move away mux suspend/resume calls Roman Penyaev
2024-10-16 10:26 ` [PATCH v4 4/8] chardev/char: rename frontend mux calls Roman Penyaev
2024-10-16 10:26 ` [PATCH v4 5/8] chardev/char: introduce `mux-be-id=ID` option Roman Penyaev
2024-10-16 10:26 ` [PATCH v4 6/8] chardev/char-mux: implement backend chardev multiplexing Roman Penyaev
2024-10-16 11:13 ` Marc-André Lureau
2024-10-16 11:18 ` Marc-André Lureau
2024-10-16 14:19 ` Roman Penyaev
2024-11-20 8:00 ` Roman Penyaev
2024-12-11 9:42 ` Markus Armbruster
2024-12-17 10:32 ` Roman Penyaev
2024-12-19 13:45 ` Markus Armbruster
2025-01-16 11:27 ` Kevin Wolf
2025-01-17 8:03 ` Roman Penyaev
2025-01-17 13:20 ` Kevin Wolf
2024-10-16 10:26 ` [PATCH v4 7/8] tests/unit/test-char: add unit test for the `mux-be` multiplexer Roman Penyaev
2024-10-16 11:36 ` Marc-André Lureau
2024-10-17 13:48 ` Roman Penyaev
2024-10-16 10:26 ` [PATCH v4 8/8] qemu-options.hx: describe multiplexing of several backend devices Roman Penyaev
2024-10-16 11:27 ` Marc-André Lureau [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAMxuvayHTYDsXAp=8pwixa15g+oDWC-CSGYhg=RB5RpWdtB0_w@mail.gmail.com' \
--to=marcandre.lureau@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=r.peniaev@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).