Re: [PATCH v2 0/5] ui/console-vc: various fixes and improvements

2025-03-04 Thread Roman Penyaev
Hi Marc-André, Do you want me to resend the series with the review tag incorporated? Or are you fine to pull as-is if there is nothing left to address from my side? -- Roman On Wed, Feb 26, 2025 at 11:06 AM Marc-André Lureau wrote: > > Hi, > > On Wed, Feb 26, 2025 at 11:59 AM R

Re: [PATCH 1/1] qapi/char.json: minor doc rewording for `hub` device

2025-02-26 Thread Roman Penyaev
Hi Marc-Andre, If you don't have objections to this one small doc change, could you please pull the change? Thanks. -- Roman On Wed, Feb 19, 2025 at 2:24 PM Markus Armbruster wrote: > > Roman Penyaev writes: > > > Refine documentation for the hub device, specify the max

[PATCH v2 5/5] ui/console-vc: implement DCH (delete) and ICH (insert) commands

2025-02-26 Thread Roman Penyaev
1] https://vt100.net/docs/vt510-rm/ICH.html Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- ui/console-vc.c | 88 + 1 file changed, 88 insertions(+) diff --git a/ui/console-vc.c b/ui/console-vc.c index 522

[PATCH v2 3/5] ui/console-vc: report cursor position in the screen not in the scroll buffer

2025-02-26 Thread Roman Penyaev
ange the row number was always increasing for the QEMU VC and represents the cursor position relative to the backscroll buffer. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- ui/console-vc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff -

[PATCH v2 2/5] ui/console-vc: report to the application instead of screen rendering

2025-02-26 Thread Roman Penyaev
100.net/docs/vt100-ug/chapter3.html#CPR Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- ui/console-vc.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ui/console-vc.c b/ui/console-vc.c index 90ff0ffda8c5..d512f57e10a9 10064

[PATCH v2 1/5] ui/console-vc: introduce parsing of the 'ESC ( ' sequence

2025-02-26 Thread Roman Penyaev
B B 2 root 20 0 0 0 0 S B [1] https://vt100.net/docs/vt100-ug/chapter3.html#SCS Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- ui/console-vc.c | 16 1 file changed, 16 insertions(+) diff --git a

[PATCH v2 4/5] ui/console-vc: add support for cursor DECSC and DECRC commands

2025-02-26 Thread Roman Penyaev
/DECRC.html [3] https://wiki.archlinux.org/title/Working_with_the_serial_console#Resizing_a_terminal Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- ui/console-vc.c | 40 ++-- 1 file changed, 34 insertions(+), 6

[PATCH v2 0/5] ui/console-vc: various fixes and improvements

2025-02-26 Thread Roman Penyaev
ad of inserting a "space" with the current attribute, call `vc_clear_xy()` for the inserted character. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: Kevin Wolf Cc: Daniel P. Berrange Cc: qemu-devel@nongnu.org Roman Penyaev (5): ui/console-vc: introduce parsing

Re: [PATCH 5/5] ui/console-vc: implement DCH (delete) and ICH (insert) commands

2025-02-25 Thread Roman Penyaev
On Mon, Feb 24, 2025 at 8:25 AM Marc-André Lureau wrote: > > Hi > > On Sun, Feb 23, 2025 at 6:56 PM Roman Penyaev wrote: > > > > This patch implements DCH (delete character) and ICH (insert > > character) commands. > > > > DCH - Delete Character: > &

[PATCH 4/5] ui/console-vc: add support for cursor DECSC and DECRC commands

2025-02-23 Thread Roman Penyaev
/DECRC.html [3] https://wiki.archlinux.org/title/Working_with_the_serial_console#Resizing_a_terminal Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- ui/console-vc.c | 40 ++-- 1 file changed, 34 insertions(+), 6

[PATCH 2/5] ui/console-vc: report to the application instead of screen rendering

2025-02-23 Thread Roman Penyaev
100.net/docs/vt100-ug/chapter3.html#CPR Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- ui/console-vc.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ui/console-vc.c b/ui/console-vc.c index 90ff0ffda8c5..d512f57e10a9 10064

[PATCH 5/5] ui/console-vc: implement DCH (delete) and ICH (insert) commands

2025-02-23 Thread Roman Penyaev
1] https://vt100.net/docs/vt510-rm/ICH.html Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- ui/console-vc.c | 108 +--- 1 file changed, 102 insertions(+), 6 deletions(-) diff --git a/ui/console-vc.c b/ui/c

[PATCH 1/5] ui/console-vc: introduce parsing of the 'ESC ( ' sequence

2025-02-23 Thread Roman Penyaev
B B 2 root 20 0 0 0 0 S B [1] https://vt100.net/docs/vt100-ug/chapter3.html#SCS Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- ui/console-vc.c | 16 1 file changed, 16 insertions(+) diff --git a

[PATCH 0/5] ui/console-vc: various fixes and improvements

2025-02-23 Thread Roman Penyaev
minal-based apps. Without them, the console is quite frustrating to use. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: Kevin Wolf Cc: Daniel P. Berrange Cc: qemu-devel@nongnu.org Roman Penyaev (5): ui/console-vc: introduce parsing of the 'ESC ( ' sequence ui/

[PATCH 3/5] ui/console-vc: report cursor position in the screen not in the scroll buffer

2025-02-23 Thread Roman Penyaev
ange the row number was always increasing for the QEMU VC and represents the cursor position relative to the backscroll buffer. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- ui/console-vc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff -

Re: [PATCH v9 2/4] chardev/char-hub: implement backend chardev aggregator

2025-02-19 Thread Roman Penyaev
On Tue, Feb 18, 2025 at 8:57 AM Markus Armbruster wrote: > > Just realized this has been committed already. I'm not complaining, I > was late. Address my doc nits in a followup patch? Sent. Please take a look. -- Roman

[PATCH 1/1] qapi/char.json: minor doc rewording for `hub` device

2025-02-19 Thread Roman Penyaev
Refine documentation for the hub device, specify the maximum. Signed-off-by: Roman Penyaev Cc: Marc-André Lureau Cc: Markus Armbruster Cc: qemu-devel@nongnu.org --- qapi/char.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/char.json b/qapi/char.json index

Re: [PATCH v9 0/4] chardev: implement backend chardev multiplexing

2025-02-03 Thread Roman Penyaev
Hi Marc-Andre, Do you plan to pull the latest version of this series, or is there something which I have to address? Please let me know. Thanks. -- Roman On Thu, Jan 23, 2025 at 9:53 AM Roman Penyaev wrote: > > Mux is a character backend (host side) device, which multiplexes >

[PATCH v9 0/4] chardev: implement backend chardev multiplexing

2025-01-23 Thread Roman Penyaev
of previously failed backend device * Proper json support of the `mux-be-id` option * Unit test for the `mux-be` multiplexer [1] https://www.qemu.org/docs/master/system/qemu-manpage.html#hxtool-6 [2] https://github.com/lf-edge/eve Signed-off-by: Roman Penyaev Reviewed-by: "Marc-André Lureau&q

[PATCH v9 1/4] chardev/char-pty: send CHR_EVENT_CLOSED on disconnect

2025-01-23 Thread Roman Penyaev
Change makes code symmetric to the code, which handles the "connected" state, i.e. send CHR_EVENT_CLOSED when state changes from "connected" to "disconnected". This behavior is similar to char-socket, for example. Signed-off-by: Roman Penyaev Reviewed-by: "Mar

[PATCH v9 2/4] chardev/char-hub: implement backend chardev aggregator

2025-01-23 Thread Roman Penyaev
JSON lists in 'key=val' pairs format of the util/keyval.c, despite the fact that modern QAPI way of parsing, namely qobject_input_visitor_new_str(), is not used. Choice of keeping QAPI list syntax may help to smoothly switch to modern parsing in the future. Signed-off-by: Roman Penyaev

[PATCH v9 3/4] tests/unit/test-char: add unit tests for hub chardev backend

2025-01-23 Thread Roman Penyaev
igurations. Signed-off-by: Roman Penyaev Reviewed-by: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- tests/unit/test-char.c | 398 + 1 file changed, 398 insertions(+) diff --git a/tests/unit/test-char.c b/tests/unit/test-char.c index 98a60d

[PATCH v9 4/4] qemu-options.hx: describe hub chardev and aggregation of several backends

2025-01-23 Thread Roman Penyaev
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 Reviewed-by: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- qemu-optio

Re: [PATCH v7 2/4] chardev/char-hub: implement backend chardev aggregator

2025-01-22 Thread Roman Penyaev
On Wed, Jan 22, 2025 at 3:44 PM Alex Bennée wrote: > > Roman Penyaev writes: > > > This patch implements a new chardev backend `hub` device, which > > aggregates input from multiple backend devices and forwards it to a > > single frontend device. Additionally, `h

[PATCH v8 0/4] chardev: implement backend chardev multiplexing

2025-01-21 Thread Roman Penyaev
oper json support of the `mux-be-id` option * Unit test for the `mux-be` multiplexer [1] https://www.qemu.org/docs/master/system/qemu-manpage.html#hxtool-6 [2] https://github.com/lf-edge/eve Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: Markus Armbruster Cc: Kevin Wolf Cc: D

[PATCH v8 3/4] tests/unit/test-char: add unit tests for hub chardev backend

2025-01-21 Thread Roman Penyaev
igurations. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- tests/unit/test-char.c | 398 + 1 file changed, 398 insertions(+) diff --git a/tests/unit/test-char.c b/tests/unit/test-char.c index 98a60d86b143.

[PATCH v8 2/4] chardev/char-hub: implement backend chardev aggregator

2025-01-21 Thread Roman Penyaev
JSON lists in 'key=val' pairs format of the util/keyval.c, despite the fact that modern QAPI way of parsing, namely qobject_input_visitor_new_str(), is not used. Choice of keeping QAPI list syntax may help to smoothly switch to modern parsing in the future. Signed-off-by: Roman Penyaev Cc

[PATCH v8 1/4] chardev/char-pty: send CHR_EVENT_CLOSED on disconnect

2025-01-21 Thread Roman Penyaev
Change makes code symmetric to the code, which handles the "connected" state, i.e. send CHR_EVENT_CLOSED when state changes from "connected" to "disconnected". This behavior is similar to char-socket, for example. Signed-off-by: Roman Penyaev Reviewed-by: "A

[PATCH v8 4/4] qemu-options.hx: describe hub chardev and aggregation of several backends

2025-01-21 Thread Roman Penyaev
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é Lureau" Cc: qemu-devel@nongnu.org --- qemu-options.hx | 49 ++

Re: [PATCH v7 4/4] qemu-options.hx: describe hub chardev and aggregation of several backends

2025-01-21 Thread Roman Penyaev
On Tue, Jan 21, 2025 at 4:23 PM Roman Penyaev wrote: > > On Tue, Jan 21, 2025 at 4:02 PM Alex Bennée wrote: > > > > Roman Penyaev writes: > > > > > This adds a few lines describing `hub` aggregator configuration > > > for aggregation of seve

Re: [PATCH v7 4/4] qemu-options.hx: describe hub chardev and aggregation of several backends

2025-01-21 Thread Roman Penyaev
On Tue, Jan 21, 2025 at 4:02 PM Alex Bennée wrote: > > Roman Penyaev writes: > > > This adds a few lines describing `hub` aggregator configuration > > for aggregation of several backend devices with a single frontend > > device. > > > > Signed-off-by: Ro

Re: [PATCH v7 2/4] chardev/char-hub: implement backend chardev aggregator

2025-01-21 Thread Roman Penyaev
Hi Marc-André, On Mon, Jan 20, 2025 at 12:21 PM Marc-André Lureau wrote: > > Hi > > On Sat, Jan 18, 2025 at 8:41 PM Roman Penyaev wrote: > > > > This patch implements a new chardev backend `hub` device, which > > aggregates input from multiple backend devices a

[PATCH v7 4/4] qemu-options.hx: describe hub chardev and aggregation of several backends

2025-01-18 Thread Roman Penyaev
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é Lureau" Cc: qemu-devel@nongnu.org --- qemu-options.hx | 48 +

[PATCH v7 2/4] chardev/char-hub: implement backend chardev aggregator

2025-01-18 Thread Roman Penyaev
JSON lists in 'key=val' pairs format of the util/keyval.c, despite the fact that modern QAPI way of parsing, namely qobject_input_visitor_new_str(), is not used. Choice of keeping QAPI list sytax may help to smoothly switch to modern parsing in the future. Signed-off-by: Roman Penyaev Cc

[PATCH v7 0/4] chardev: implement backend chardev multiplexing

2025-01-18 Thread Roman Penyaev
ltiplexer `mux-be` * Handle EAGAIN on write to the backend device * Support of watch of previously failed backend device * Proper json support of the `mux-be-id` option * Unit test for the `mux-be` multiplexer [1] https://www.qemu.org/docs/master/system/qemu-manpage.html#hxtool-6 [2] https://github

[PATCH v7 3/4] tests/unit/test-char: add unit tests for hub chardev backend

2025-01-18 Thread Roman Penyaev
igurations. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- chardev/char-hub.c | 4 +- tests/unit/test-char.c | 399 + 2 files changed, 401 insertions(+), 2 deletions(-) diff --git a/chardev/char-hub.c

[PATCH v7 1/4] chardev/char-pty: send CHR_EVENT_CLOSED on disconnect

2025-01-18 Thread Roman Penyaev
Change makes code symmetric to the code, which handles the "connected" state, i.e. send CHR_EVENT_CLOSED when state changes from "connected" to "disconnected". This behavior is similar to char-socket, for example. Signed-off-by: Roman Penyaev Cc: "Marc-André

Re: [PATCH v4 6/8] chardev/char-mux: implement backend chardev multiplexing

2025-01-17 Thread Roman Penyaev
Hi Kevin, On Thu, Jan 16, 2025 at 12:27 PM Kevin Wolf wrote: > > Am 17.12.2024 um 11:32 hat Roman Penyaev geschrieben: > > Hi Markus, > > > > Thanks for the explicit info. But I have a lot to ask :) > > Do I understand correctly that there are two ways to par

Re: [PATCH v6 6/8] chardev/char-mux: implement backend chardev multiplexing

2025-01-10 Thread Roman Penyaev
On Fri, Jan 10, 2025 at 9:58 AM Daniel P. Berrangé wrote: > > On Fri, Jan 10, 2025 at 09:43:52AM +0100, Roman Penyaev wrote: > > On Thu, Jan 9, 2025 at 7:07 PM Daniel P. Berrangé > > wrote: > > > > > > On Thu, Jan 09, 2025 at 01:56:40PM +0100, Roman Penyaev w

Re: [PATCH v6 6/8] chardev/char-mux: implement backend chardev multiplexing

2025-01-10 Thread Roman Penyaev
On Thu, Jan 9, 2025 at 7:07 PM Daniel P. Berrangé wrote: > > On Thu, Jan 09, 2025 at 01:56:40PM +0100, Roman Penyaev wrote: > > Hi, > > > > On Tue, Jan 7, 2025 at 3:57 PM Marc-André Lureau > > wrote: > > > Whether we talk about multiplexing front-end or bac

Re: [PATCH v6 6/8] chardev/char-mux: implement backend chardev multiplexing

2025-01-09 Thread Roman Penyaev
Hi, On Tue, Jan 7, 2025 at 3:57 PM Marc-André Lureau wrote: > > Hi [cut] > > > But next attempt to write will loop over the same backend again, which > > > will see the "same" write multiple times. > > > > This case is handled by checking the difference between counters > > `d->be_written[i]` a

Re: [PATCH v6 0/8] chardev: implement backend chardev multiplexing

2025-01-02 Thread Roman Penyaev
On Mon, Dec 30, 2024 at 12:35 PM Marc-André Lureau wrote: > > That looks like a good compromise to me, thanks. Markus, wdyt? > > In your patches, please change version 9.3 for 10.0 (next release). Ok. > btw, for some reason your series is not caught by patchew or > patchwork.. it's a bit annoyin

Re: [PATCH v6 6/8] chardev/char-mux: implement backend chardev multiplexing

2025-01-02 Thread Roman Penyaev
Hi, First of all Happy New Year :) On Mon, Dec 30, 2024 at 12:41 PM Marc-André Lureau wrote: [cut] > > + > > +for (i = 0; i < d->be_cnt; i++) { > > +written = d->be_written[i] - d->be_min_written; > > +if (written) { > > +/* Written in the previous call so take

Re: [PATCH v4 6/8] chardev/char-mux: implement backend chardev multiplexing

2024-12-17 Thread Roman Penyaev
t; > > Hi > > > > On Wed, Oct 16, 2024 at 2:29 PM Roman Penyaev wrote: > > > >> This patch implements multiplexing capability of several backend > >> devices, which opens up an opportunity to use a single frontend > >> device on the guest, which can

[PATCH v3 1/2] chardev/char-mux: shift unsigned long to avoid 32-bit overflow

2024-11-29 Thread Roman Penyaev
Allthough the size of MAX_MUX is equal to 4 and likely will never change, this patch changes type of constant to unsigned long to be on the safe side. Also add a static compile check that MAX_MUX never bigger than `sizeof(d->mux_bitset) * BITS_PER_BYTE`. Signed-off-by: Roman Penyaev Reviewed

[PATCH v3 2/2] chardev/char-mux: make boolean bit check instead of find_next_bit()

2024-11-29 Thread Roman Penyaev
This patch simplifies (and makes less confusing) bit checks by replacing `find_next_bit()` calls with boolean AND operation. Resolves: Coverity CID 1563776 Signed-off-by: Roman Penyaev Reviewed-by: "Marc-André Lureau" Cc: Peter Maydell Cc: Paolo Bonzini Reviewed-by: Clément Mathieu

[PATCH v3 0/2] chardev/char-mux: tweak mux bitset operations

2024-11-29 Thread Roman Penyaev
ing that) * Rebase on latest master v1..v2: * Rebase on latest master, incorporate review tags. Roman Penyaev (2): chardev/char-mux: shift unsigned long to avoid 32-bit overflow chardev/char-mux: make boolean bit check instead of find_next_bit() chardev/char-mux.c | 15 +++ 1 f

Re: [PATCH v2 0/2] chardev/char-mux: tweak mux bitset operations

2024-11-25 Thread Roman Penyaev
UX never bigger than > > `sizeof(d->mux_bitset)`. > > This needs to be multiplied by CHAR_BIT. > > Paolo > > On 11/20/24 08:53, Roman Penyaev wrote: > > Patchset tweaks bitset operations by changing a constant to unsigned > > long, introduces a static com

Re: [PATCH v4 6/8] chardev/char-mux: implement backend chardev multiplexing

2024-11-20 Thread Roman Penyaev
, Oct 16, 2024 at 1:14 PM Marc-André Lureau wrote: > > Hi > > On Wed, Oct 16, 2024 at 2:29 PM Roman Penyaev wrote: >> >> This patch implements multiplexing capability of several backend >> devices, which opens up an opportunity to use a single frontend >> device on

[PATCH v2 0/2] chardev/char-mux: tweak mux bitset operations

2024-11-19 Thread Roman Penyaev
Patchset tweaks bitset operations by changing a constant to unsigned long, introduces a static compile check and simplifies bitset operations. v1..v2: Rebase on latest master, incorporate review tags. Roman Penyaev (2): chardev/char-mux: shift unsigned long to avoid 32-bit overflow chardev

[PATCH v2 1/2] chardev/char-mux: shift unsigned long to avoid 32-bit overflow

2024-11-19 Thread Roman Penyaev
Allthough the size of MAX_MUX is equal to 4 and likely will never change, this patch changes type of constant to unsigned long to be on the safe side. Also add a static compile check that MAX_MUX never bigger than `sizeof(d->mux_bitset)`. Signed-off-by: Roman Penyaev Reviewed-by: "Ma

[PATCH v2 2/2] chardev/char-mux: make boolean bit check instead of find_next_bit()

2024-11-19 Thread Roman Penyaev
This patch simplifies (and makes less confusing) bit checks by replacing `find_next_bit()` calls with boolean AND operation. Resolves: Coverity CID 1563776 Signed-off-by: Roman Penyaev Reviewed-by: "Marc-André Lureau" Cc: Peter Maydell Reviewed-by: Clément Mathieu--Drif Cc:

[PATCH 1/2] chardev/char-mux: shift unsigned long to avoid 32-bit overflow

2024-11-02 Thread Roman Penyaev
Allthough the size of MAX_MUX is equal to 4 and likely will never change, this patch changes type of constant to unsigned long to be on the safe side. Also add a static compile check that MAX_MUX never bigger than `sizeof(d->mux_bitset)`. Signed-off-by: Roman Penyaev Cc: "Marc-André Lur

Re: [PATCH v2 7/8] chardev/mux: implement detach of frontends from mux

2024-11-02 Thread Roman Penyaev
Hi, On Tue, Oct 22, 2024, 07:21 CLEMENT MATHIEU--DRIF < clement.mathieu--d...@eviden.com> wrote: > > > On 14/10/2024 17:24, Roman Penyaev wrote: > > Caution: External email. Do not open attachments or click links, unless > this email comes from a known sender and you

[PATCH 2/2] chardev/char-mux: make boolean bit check instead of find_next_bit()

2024-11-02 Thread Roman Penyaev
This patch simplifies (and makes less confusing) bit checks by replacing `find_next_bit()` calls with boolean AND operation. Resolves: Coverity CID 1563776 Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: Peter Maydell Cc: Clément Mathieu--Drif Cc: qemu-devel@nongnu.org --

[PATCH 0/2] chardev/char-mux: tweak mux bitset operations

2024-11-02 Thread Roman Penyaev
Patchset tweaks bitset operations by changing a constant to unsigned long, introduces a static compile check and simplifies bitset operations. Roman Penyaev (2): chardev/char-mux: shift unsigned long to avoid 32-bit overflow chardev/char-mux: make boolean bit check instead of find_next_bit

Re: [PULL 7/8] chardev/mux: implement detach of frontends from mux

2024-11-02 Thread Roman Penyaev
Hi Peter, On Fri, Nov 1, 2024 at 4:25 PM Peter Maydell wrote: > > On Tue, 15 Oct 2024 at 09:52, wrote: > > > > From: Roman Penyaev > > > > With bitset management now it becomes feasible to implement > > the logic of detaching frontends from multiplexer.

Re: [PATCH v5 0/8] chardev: implement backend chardev multiplexing

2024-10-31 Thread Roman Penyaev
On Thu, Oct 31, 2024 at 12:34 PM Marc-André Lureau wrote: > > Hi Roman > > On Thu, Oct 31, 2024 at 3:12 PM Roman Penyaev wrote: >> >> Hi Marc-André, >> >> In this 5th version of the mux-be series it seems I addressed all the >> comments and concern

Re: [PATCH v5 0/8] chardev: implement backend chardev multiplexing

2024-10-31 Thread Roman Penyaev
Hi Marc-André, In this 5th version of the mux-be series it seems I addressed all the comments and concerns. Could you please take a look once again? -- Roman On Thu, Oct 17, 2024 at 4:45 PM Roman Penyaev wrote: > > Mux is a character backend (host side) device, which multiplexes >

[PATCH v5 6/8] chardev/char-mux: implement backend chardev multiplexing

2024-10-17 Thread Roman Penyaev
` is a socket backend which provides biderectional communication to the virtio hvc console. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- chardev/char-fe.c | 9 ++ chardev/char-mux-be.c | 290

[PATCH v5 3/8] chardev/char: move away mux suspend/resume calls

2024-10-17 Thread Roman Penyaev
/mux_suspend_open/g s/resume_mux_open/mux_resume_open/g No functional changes are made. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- chardev/char-mux-fe.c | 63 ++--- chardev/char.c

[PATCH v5 7/8] tests/unit/test-char: add unit test for the `mux-be` multiplexer

2024-10-17 Thread Roman Penyaev
The test is trivial: several backends, 1 `mux-be`, 1 frontend do the buffer write and read. Pipe is used for EAGAIN verification. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- tests/unit/test-char.c | 323 +++

[PATCH v5 5/8] chardev/char: introduce `mux-be-id=ID` option

2024-10-17 Thread Roman Penyaev
Patch introduces `mux-be-id=ID` option for all chardev devices. This is necessary to attach chardev to `mux-be` for backend multiplexing. Actual implementation wimplementation will follow. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- chardev/

[PATCH v5 0/8] chardev: implement backend chardev multiplexing

2024-10-17 Thread Roman Penyaev
e * Proper json support of the `mux-be-id` option * Unit test for the `mux-be` multiplexer [1] https://www.qemu.org/docs/master/system/qemu-manpage.html#hxtool-6 [2] https://github.com/lf-edge/eve Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org R

[PATCH v5 2/8] chardev/char: rename `char-mux.c` to `char-mux-fe.c`

2024-10-17 Thread Roman Penyaev
In the following patches backend multiplexer will be introduced and the implementation will be named as follows: `char-mux-be.c`. This patch renames the frontend multiplexer from `char-mux.c` to `char-mux-fe.c`. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@

[PATCH v5 4/8] chardev/char: rename frontend mux calls

2024-10-17 Thread Roman Penyaev
This patch renames calls in the frontend mux implementation to reflect its frontend nature. Patch does the following: s/mux_chr/mux_fe_chr/g No functional changes are made. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- chardev/char-fe.c

[PATCH v5 8/8] qemu-options.hx: describe multiplexing of several backend devices

2024-10-17 Thread Roman Penyaev
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é Lureau" Cc: qemu-devel@nongnu.org --- qemu-optio

[PATCH v5 1/8] chardev/char: rename `MuxChardev` struct to `MuxFeChardev`

2024-10-17 Thread Roman Penyaev
/CHARDEV_IS_MUX_FE/g s/MUX_CHARDEV/MUX_FE_CHARDEV/g s/TYPE_CHARDEV_MUX/TYPE_CHARDEV_MUX_FE/g No json or string types are changed for the sake of compatibility. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- chardev/char-fe.c | 10 +- chardev/

Re: [PATCH v4 7/8] tests/unit/test-char: add unit test for the `mux-be` multiplexer

2024-10-17 Thread Roman Penyaev
Hi Marc-André, On Wed, Oct 16, 2024 at 1:36 PM Marc-André Lureau wrote: > > Hi > > On Wed, Oct 16, 2024 at 2:28 PM Roman Penyaev wrote: > > > > The test is trivial: several backends, 1 `mux-be`, 1 frontend > > do the buffer write and read. Pipe is used for EAGAI

Re: [PATCH v4 6/8] chardev/char-mux: implement backend chardev multiplexing

2024-10-16 Thread Roman Penyaev
Hi, On Wed, Oct 16, 2024 at 1:14 PM Marc-André Lureau wrote: > > Hi > > On Wed, Oct 16, 2024 at 2:29 PM Roman Penyaev wrote: >> >> This patch implements multiplexing capability of several backend >> devices, which opens up an opportunity to use a single frontend

[PATCH v4 6/8] chardev/char-mux: implement backend chardev multiplexing

2024-10-16 Thread Roman Penyaev
` is a socket backend which provides biderectional communication to the virtio hvc console. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- chardev/char-fe.c | 9 ++ chardev/char-mux-be.c | 290

[PATCH v4 3/8] chardev/char: move away mux suspend/resume calls

2024-10-16 Thread Roman Penyaev
/mux_suspend_open/g s/resume_mux_open/mux_resume_open/g No functional changes are made. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- chardev/char-mux-fe.c | 63 ++--- chardev/char.c

[PATCH v4 4/8] chardev/char: rename frontend mux calls

2024-10-16 Thread Roman Penyaev
This patch renames calls in the frontend mux implementation to reflect its frontend nature. Patch does the following: s/mux_chr/mux_fe_chr/g No functional changes are made. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- chardev/char-fe.c

[PATCH v4 8/8] qemu-options.hx: describe multiplexing of several backend devices

2024-10-16 Thread Roman Penyaev
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é Lureau" Cc: qemu-devel@nongnu.org --- qemu-optio

[PATCH v4 2/8] chardev/char: rename `char-mux.c` to `char-mux-fe.c`

2024-10-16 Thread Roman Penyaev
In the following patches backend multiplexer will be introduced and the implementation will be named as follows: `char-mux-be.c`. This patch renames the frontend multiplexer from `char-mux.c` to `char-mux-fe.c`. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@

[PATCH v4 5/8] chardev/char: introduce `mux-be-id=ID` option

2024-10-16 Thread Roman Penyaev
Patch introduces `mux-be-id=ID` option for all chardev devices. This is necessary to attach chardev to `mux-be` for backend multiplexing. Actual implementation wimplementation will follow. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- chardev/

[PATCH v4 1/8] chardev/char: rename `MuxChardev` struct to `MuxFeChardev`

2024-10-16 Thread Roman Penyaev
/CHARDEV_IS_MUX_FE/g s/MUX_CHARDEV/MUX_FE_CHARDEV/g s/TYPE_CHARDEV_MUX/TYPE_CHARDEV_MUX_FE/g No json or string types are changed for the sake of compatibility. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- chardev/char-fe.c | 10 +- chardev/

[PATCH v4 7/8] tests/unit/test-char: add unit test for the `mux-be` multiplexer

2024-10-16 Thread Roman Penyaev
The test is trivial: several backends, 1 `mux-be`, 1 frontend do the buffer write and read. Pipe is used for EAGAIN verification. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- tests/unit/test-char.c | 306 +++

[PATCH v4 0/8] chardev: implement backend chardev multiplexing

2024-10-16 Thread Roman Penyaev
mux-be` multiplexer [1] https://www.qemu.org/docs/master/system/qemu-manpage.html#hxtool-6 [2] https://github.com/lf-edge/eve Roman Penyaev (8): chardev/char: rename `MuxChardev` struct to `MuxFeChardev` chardev/char: rename `char-mux.c` to `char-mux-fe.c` chardev/char: move away mux suspend/resum

Re: [PATCH v2 8/8] tests/unit/test-char: implement a few mux remove test cases

2024-10-15 Thread Roman Penyaev
Hi, On Tue, Oct 15, 2024, 10:50 Marc-André Lureau wrote: [cut] > qemu_chr_fe_deinit(&chr_be1, false); > > -qemu_chr_fe_deinit(&chr_be2, true); > > + > > +error = NULL; > > Unnecessary assignment, > > > +qmp_chardev_remove("mux-label", &error); > > +g_assert_cmpstr(error_get

[PATCH v2 4/8] chardev/mux: convert size members to unsigned int

2024-10-14 Thread Roman Penyaev
There is no sense to keep `focus`, `mux_cnt`, `prod`, `cons` and `tag` variables as signed, those represent either size, either position in array, which both are unsigned. `focus` member of `MuxChardev` is kept signed, because initially set to -1. Signed-off-by: Roman Penyaev Cc: "Marc-

[PATCH v2 7/8] chardev/mux: implement detach of frontends from mux

2024-10-14 Thread Roman Penyaev
With bitset management now it becomes feasible to implement the logic of detaching frontends from multiplexer. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- chardev/char-fe.c | 2 +- chardev/char-mux.c | 21 ++--

[PATCH v2 6/8] chardev/mux: switch mux frontends management to bitset

2024-10-14 Thread Roman Penyaev
in the `backend` array (yes, huge confusion with backend and frontends names). Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- chardev/char-mux.c | 42 +- chardev/char.c | 2 +- chard

[PATCH v2 1/8] chardev/char: fix qemu_chr_is_busy() check

2024-10-14 Thread Roman Penyaev
`mux_cnt` struct member never goes negative or decrements, so mux chardev can be !busy only when there are no frontends attached. This patch fixes the always-true check. Fixes: a4afa548fc6d ("char: move front end handlers in CharBackend") Signed-off-by: Roman Penyaev Cc: "Marc-An

[PATCH v2 8/8] tests/unit/test-char: implement a few mux remove test cases

2024-10-14 Thread Roman Penyaev
This patch tests: 1. feasibility of removing mux which does not have frontends attached or frontends were prior detached. 2. inability to remove mux which has frontends attached (mux is "busy") Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu

[PATCH v2 2/8] chardev/chardev-internal: remove unused `max_size` struct member

2024-10-14 Thread Roman Penyaev
Clean up forgotten leftovers. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- chardev/chardev-internal.h | 1 - 1 file changed, 1 deletion(-) diff --git a/chardev/chardev-internal.h b/chardev/chardev-internal.h index 4e03af31476c..c3024b51fdda 10

[PATCH v2 0/8] chardev/mux: implement frontend detach

2024-10-14 Thread Roman Penyaev
ntend devices in any order. Also first patches do some refactoring the purpose of which is to make integer unsigned where possible (such as sizes or lengths). v1->v2: * improve if condition and assert for bit verification Roman Penyaev (8): chardev/char: fix qemu_chr_is_busy() check c

[PATCH v2 5/8] chardev/mux: introduce `mux_chr_attach_frontend() call

2024-10-14 Thread Roman Penyaev
Move away logic which attaches frontend device to a mux from `char-fe.c` to actual `char-mux.c` implementation and make it a separate function. No logic changes are made. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- chardev/char-fe.c

[PATCH v2 3/8] chardev/mux: use bool type for `linestart` and `term_got_escape`

2024-10-14 Thread Roman Penyaev
Those are boolean variables, not signed integers. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- chardev/char-mux.c | 10 +- chardev/chardev-internal.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ch

Re: [PATCH v3 1/7] chardev/char: rename `char-mux.c` to `char-mux-fe.c`

2024-10-14 Thread Roman Penyaev
On Mon, Oct 14, 2024 at 3:57 PM Marc-André Lureau wrote: > > Hi Roman, > > On Thu, Oct 10, 2024 at 2:21 PM Roman Penyaev wrote: >> >> In the following patches backend multiplexer will be >> introduced and the implementation will be named as >> follows: `ch

Re: [PATCH 7/8] chardev/mux: implement detach of frontends from mux

2024-10-14 Thread Roman Penyaev
On Mon, Oct 14, 2024 at 3:22 PM Marc-André Lureau wrote: [cut] >> >> +bool mux_chr_detach_frontend(MuxChardev *d, unsigned int tag) >> +{ >> +unsigned int bit; >> + >> +bit = find_next_bit(&d->mux_bitset, MAX_MUX, tag); >> +if (bit >= MAX_MUX) { > > > if (bit != tag) instead? Right,

Re: [PATCH 6/8] chardev/mux: switch mux frontends management to bitset

2024-10-14 Thread Roman Penyaev
On Mon, Oct 14, 2024 at 3:20 PM Marc-André Lureau wrote: > > > > On Mon, Oct 14, 2024 at 3:45 PM Roman Penyaev wrote: >> >> Frontends can be attached and detached during run-time (although detach >> is not implemented, but will follow). Counter variable of mux

Re: [PATCH 1/1] chardev/char: fix qemu_chr_is_busy() check

2024-10-14 Thread Roman Penyaev
Hi Marc-André, On Thu, Oct 10, 2024 at 12:20 PM Marc-André Lureau wrote: > > Hi Roman > > On Thu, Oct 10, 2024 at 1:28 PM Roman Penyaev wrote: >> >> `mux_cnt` struct member never goes negative or decrements, >> so mux chardev can be !busy only when there are no >

[PATCH 3/8] chardev/mux: use bool type for `linestart` and `term_got_escape`

2024-10-14 Thread Roman Penyaev
Those are boolean variables, not signed integers. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- chardev/char-mux.c | 10 +- chardev/chardev-internal.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ch

[PATCH 1/8] chardev/char: fix qemu_chr_is_busy() check

2024-10-14 Thread Roman Penyaev
`mux_cnt` struct member never goes negative or decrements, so mux chardev can be !busy only when there are no frontends attached. This patch fixes the always-true check. Fixes: a4afa548fc6d ("char: move front end handlers in CharBackend") Signed-off-by: Roman Penyaev Cc: "Marc-An

[PATCH 0/8] chardev/mux: implement frontend detach

2024-10-14 Thread Roman Penyaev
ntend devices in any order. Also first patches do some refactoring the purpose of which is to make integer unsigned where possible (such as sizes or lengths). Roman Penyaev (8): chardev/char: fix qemu_chr_is_busy() check chardev/chardev-internal: remove unused `max_size` struct member charde

[PATCH 5/8] chardev/mux: introduce `mux_chr_attach_frontend() call

2024-10-14 Thread Roman Penyaev
Move away logic which attaches frontend device to a mux from `char-fe.c` to actual `char-mux.c` implementation and make it a separate function. No logic changes are made. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- chardev/char-fe.c

[PATCH 2/8] chardev/chardev-internal: remove unused `max_size` struct member

2024-10-14 Thread Roman Penyaev
Clean up forgotten leftovers. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- chardev/chardev-internal.h | 1 - 1 file changed, 1 deletion(-) diff --git a/chardev/chardev-internal.h b/chardev/chardev-internal.h index 4e03af31476c..c3024b51fdda 10

[PATCH 8/8] tests/unit/test-char: implement a few mux remove test cases

2024-10-14 Thread Roman Penyaev
This patch tests: 1. feasibility of removing mux which does not have frontends attached or frontends were prior detached. 2. inability to remove mux which has frontends attached (mux is "busy") Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu

[PATCH 7/8] chardev/mux: implement detach of frontends from mux

2024-10-14 Thread Roman Penyaev
With bitset management now it becomes feasible to implement the logic of detaching frontends from multiplexer. Signed-off-by: Roman Penyaev Cc: "Marc-André Lureau" Cc: qemu-devel@nongnu.org --- chardev/char-fe.c | 2 +- chardev/char-mux.c | 20 +--

  1   2   >