From nobody Sun Apr 6 02:59:32 2025 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=1737218546; cv=none; d=zohomail.com; s=zohoarc; b=PhB9w/5BG6A/5xVfJ7o8APFJOabP6cOT++QCglBmztG7NedmkSh2Js5FoXuSG95kBpfQKxsj2us6DoRKq0ugHtpk+0XaJL7H+juVClU88jCwvfR3dShawpNecNrozd033fS76oC6BjAmkIGCFwEvVTZ3DfYVsORHHen5/jCe/Jg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737218546; 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=XS8D9xyhI/DY96ppKfNxJeg817Y9hprKgKWhJEwYKyo=; b=H1FWXVhbMi5P2vF+Gkom+OkkAkPRmolIPvWurlM6EMHY+0KZ8R7olzKw36ltb/7Zi9cAKLRfG0Q1e5vf2lzwIGIra6D1dZTIf/+lsCXG/XaEnj1BrUErvCGMg4wOB2HLLPb93hhBhHTJdRgC6B1IWqwLdZtlL22r5N1UA9RrIPI= 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 1737218546646630.4739949034099; Sat, 18 Jan 2025 08:42:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tZBt5-00041F-Nf; Sat, 18 Jan 2025 11:41:31 -0500 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 1tZBsw-0003wp-UY for qemu-devel@nongnu.org; Sat, 18 Jan 2025 11:41:24 -0500 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tZBsv-0007ou-Cs for qemu-devel@nongnu.org; Sat, 18 Jan 2025 11:41:22 -0500 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-5d982de9547so6125332a12.2 for ; Sat, 18 Jan 2025 08:41:21 -0800 (PST) Received: from think.fritz.box ([2a02:8109:8384:1400:d15a:20d8:4bbe:9a4c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384f8624fsm358331266b.150.2025.01.18.08.41.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jan 2025 08:41:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737218480; x=1737823280; 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=XS8D9xyhI/DY96ppKfNxJeg817Y9hprKgKWhJEwYKyo=; b=i0ohyx8a/BJKfMV+T3oGxB6AAtaC2g0tDL3IAM4UODjcvIx5FwU1GeYtmSKDeRFrzU +e/yP3EdhuUEdA5eXmEurRfN70qlfRWAXwKZA+uVqs//DIr/2EjJXrk4w5cfnm/tOROi R8N5xCBWFoh9t2lqgrnbfbKNRxtuMKjHeWXRTq9J9gekp/yObwdMg/wWrXraMZDyUzt4 Xr73ITRpg8qQ8nnaRmGue5Rj99xY4JgUGwEASrpCXsoLP2GseqskTX5FRrYN8OScKdmX iiMUJq10boVNZup4UHAUxRj22O8pmPk+bZpiaCx+fyGtF5cCWe4KTk2aAc+cGS9RT8o4 2mMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737218480; x=1737823280; 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=XS8D9xyhI/DY96ppKfNxJeg817Y9hprKgKWhJEwYKyo=; b=qrmlOf10lgf8M8Vqct4Y7wqSOQUUsfYSMfPuhWRja8BGuQ2m8iyq0NElbEATNJxyE2 NZaVObK9J5MqxnzQGkwjbHOSBtVCvPvD4jTucRQG6GIW9NRRLqXb/z8kZsO+f50aWuwy E21/VrDsY/rtYV8c1z6QkXlFEuLWbbiuWRGoIohWI5kVlKCY29HoVK90gvUr7Efzy/L2 gQ1t9ykkMIPbWKsL9YXDX7abzVCBLhxubMxgp6WkIrMvD/hP0ykY2zzs9Fx7ULWgSSsP xchszbej/lEApycSTQobUPOgngAK8NaHW1wT1qbNiN4fGyplgd+HXoliMtp1Wzis3zsp fanQ== X-Forwarded-Encrypted: i=1; AJvYcCVD7u4mWplXZqGDC0P85xtUurdLs5M6jtLZ/yC2Bmoz6bkBa1/YmLmxeu+EpCC978KnCD+BZHoKYpgc@nongnu.org X-Gm-Message-State: AOJu0Ywzmy5Ydp38mmFGOEeSGvTXCnq9TjR6Or7T6/TeKFgitdKUWO7o dGz5V/dMDFOnrWaFtp3taoch/eVSQYaifjpD5Ufz7FKc3g/rGlJh X-Gm-Gg: ASbGncuF+04q+Px7EKobn5dKKuZgjOVsRg1h0jpFULOC11W7yWce0GyuBD2ocymDu2f OJ5miHhov6HsOS6udgCWeKInhGesR6gXfP8JnhLXfdN+8jwR5PZ3u38WtDUqtq3FvkTN5TnzQz2 +Mpx+FlEwcc8ygxEZcCzTnhLE4wWS443CLAexr0mlYjMyRKTNZ0w74P0vuh/KoXM2Roc/OLHY75 2QSomk/40Ohebwi8igtfGWP3hLzX7N3JKpCk2XGdGoA5mhDQ1HC4EVEjwU19fJLyXRtT2v6xxpg qek= X-Google-Smtp-Source: AGHT+IFcWH3+MLwzKCls063trOBw0HLqQFo1I9sDWsFTB/4vosRl+D2Ex6kdIEV8AGVDY2ZNxa+UYQ== X-Received: by 2002:a17:907:1c1c:b0:ab2:c3ef:ed1e with SMTP id a640c23a62f3a-ab38b0b6891mr610759666b.10.1737218478206; Sat, 18 Jan 2025 08:41:18 -0800 (PST) From: Roman Penyaev To: Cc: Roman Penyaev , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-devel@nongnu.org Subject: [PATCH v7 4/4] qemu-options.hx: describe hub chardev and aggregation of several backends Date: Sat, 18 Jan 2025 17:40:52 +0100 Message-ID: <20250118164056.830721-5-r.peniaev@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250118164056.830721-1-r.peniaev@gmail.com> References: <20250118164056.830721-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::529; envelope-from=r.peniaev@gmail.com; helo=mail-ed1-x529.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: 1737218546950019000 This adds a few lines describing `hub` aggregator configuration for aggregation of 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 | 48 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 7090d59f6f10..fdc46f7e68b3 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -3720,7 +3720,7 @@ 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``, + Backend is one of: ``null``, ``socket``, ``udp``, ``msmouse``, ``hub``, ``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. =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 aggregate data in the opposite direction (where one + QEMU frontend interface receives input and output from multiple + backend chardev devices), please refer to the paragraph below + regarding chardev ``hub`` aggregator device 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 +3880,45 @@ The available backends are: Forward QEMU's emulated msmouse events to the guest. ``msmouse`` does not take any options. =20 +``-chardev hub,id=3Did,chardevs.0=3Did[,chardevs.N=3Did]`` Explicitly crea= te + chardev backend hub device with the possibility to aggregate input + from multiple backend devices and forward it to a single frontend + device. Additionally, `hub` device takes the output from the + frontend device and sends it back to all the connected backend + devices. This allows for seamless interaction between different + backend devices and a single frontend interface. Aggregation + supported for up to 4 chardev devices. (Since 10.0) + + For example, the following is a use case of 2 backend devices: + virtual console ``vc0`` and a pseudo TTY ``pty0`` connected to + a single virtio hvc console frontend device with a hub ``hub0`` + help. Virtual console renders text to an image, which can be + shared over the VNC protocol. In turn, pty backend provides + bidirectional communication to the virtio hvc console over the + pseudo TTY file. The example configuration can be as follows: + + :: + + -chardev pty,path=3D/tmp/pty,id=3Dpty0 \ + -chardev vc,id=3Dvc0 \ + -chardev hub,id=3Dhub0,chardevs.0=3Dpty0,chardevs.1=3Dvc0 \ + -device virtconsole,chardev=3Dhub0 \ + -vnc 0.0.0.0:0 + + Once QEMU starts VNC client and any TTY emulator can be used to + control a single hvc console: + + :: + + # Start TTY emulator + tio /tmp/pty + + # Start VNC client and switch to virtual console Ctrl-Alt-2 + vncviewer :0 + + Several frontend devices is not supported. Stacking of multiplexers + and hub devices 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.43.0