On Sat, May 28, 2016 at 12:27 AM, Stefan Hajnoczi wrote:
> On Fri, May 27, 2016 at 01:55:04PM +0200, Roman Pen wrote:
>> Hello, all.
>>
>> This is RFC because mostly this patch is a quick attempt to get true
>> multithreaded multiqueue support for a block device with native AIO.
>> The goal is to
On Mon, May 30, 2016 at 8:40 AM, Alexandre DERUMIER wrote:
> Hi,
>
>>>To avoid any locks in qemu backend and not to introduce thread safety
>>>into qemu block-layer I open same backend device several times, one
>>>device per one MQ. e.g. the following is the stack for a virtio-blk
>>>with num-que
Hi,
On Sat, Jun 4, 2016 at 12:26 AM, Stefan Hajnoczi wrote:
> On Thu, Jun 02, 2016 at 05:19:41PM -0700, Stefan Hajnoczi wrote:
>> On Mon, May 30, 2016 at 06:25:58PM -0700, Stefan Hajnoczi wrote:
>> > v2:
>> > * Simplify s->rq live migration [Paolo]
>> > * Use more efficient bitmap ops for batch
Hi, Stefan.
On Mon, Jun 20, 2016 at 12:36 PM, Stefan Hajnoczi wrote:
> On Tue, Jun 07, 2016 at 05:28:24PM +0100, Stefan Hajnoczi wrote:
>> v3:
>> * Drop Patch 1 to batch guest notify for non-dataplane
>>
>>The Linux AIO completion BH and the virtio-blk batch notify BH changed
>> order
>>
This adds a few lines describing multiplexer configuration for
multiplexing several backend devices with a single frontend
device.
Signed-off-by: Roman Penyaev
Cc: "Marc-André Lureau"
Cc: Paolo Bonzini
Cc: qemu-devel@nongnu.org
---
qemu-optio
hvc console.
Signed-off-by: Roman Penyaev
Cc: "Marc-André Lureau"
Cc: Paolo Bonzini
Cc: qemu-devel@nongnu.org
---
chardev/char-fe.c | 14 +++--
chardev/char-mux.c | 120 +
chardev/char.c | 2 +-
chardev/chardev-intern
nput and output due the buffer
multiplexing:
# VNC client
vncviewer :0
# TTY emulator
socat unix:connect:/tmp/sock pty,link=/tmp/pty
tio /tmp/pty
[1] https://www.qemu.org/docs/master/system/qemu-manpage.html#hxtool-6
Roman Penyaev (2):
chardev: implement backend chardev multiplexi
Hi Marc-André,
On Tue, Sep 17, 2024 at 2:31 PM Marc-André Lureau
wrote:
>
> Hi Roman
>
> On Fri, Sep 13, 2024 at 8:37 PM Roman Penyaev wrote:
> >
> > This patch implements multiplexing capability of several backend
> > devices, which opens up an opportunity to us
On Tue, Jun 28, 2016 at 11:42 AM, Stefan Hajnoczi wrote:
> On Mon, Jun 27, 2016 at 08:36:19PM +0200, Roman Penyaev wrote:
>> On Jun 27, 2016 6:37 PM, "Stefan Hajnoczi" wrote:
>> >
>> > Commit ccb9dc10129954d0bcd7814298ed445e684d5a2a ("linux-aio: Can
On Tue, Jul 12, 2016 at 4:59 PM, Paolo Bonzini wrote:
>
>
> On 12/07/2016 16:12, Roman Penyaev wrote:
>> But what is the most important thing here is, that reverting
>> "linux-aio: Cancel BH if not needed" brings these numbers:
>>
>>READ: io=56362MB,
On Wed, Jul 13, 2016 at 9:43 AM, Paolo Bonzini wrote:
>
>
> On 12/07/2016 19:51, Roman Pen wrote:
>> +if (s->io_q.in_flight >= MAX_EVENTS)
>> +break;
>> QSIMPLEQ_FOREACH(aiocb, &s->io_q.pending, next) {
>> iocbs[len++] = &aiocb->iocb;
>> -if (l
On Wed, Jul 13, 2016 at 12:31 PM, Paolo Bonzini wrote:
>
>
> On 13/07/2016 09:57, Roman Pen wrote:
>> v1..v2:
>>
>> o comment tweaks.
>> o fix QEMU coding style.
>>
>> Invoking io_setup(MAX_EVENTS) we ask kernel to create ring buffer for us
>> with specified number of events. But kernel ring
On Wed, Jul 13, 2016 at 2:22 PM, Eric Blake wrote:
> On 07/13/2016 01:57 AM, Roman Pen wrote:
>> v1..v2:
>>
>> o comment tweaks.
>> o fix QEMU coding style.
>
> The above comments should be delayed...
>
>>
>> Invoking io_setup(MAX_EVENTS) we ask kernel to create ring buffer for us
>> with spec
On Wed, Jul 13, 2016 at 1:45 PM, Kevin Wolf wrote:
> Am 13.07.2016 um 13:33 hat Roman Penyaev geschrieben:
>> Just to be sure that we are on the same page:
>>
>> 1. We have this commit "linux-aio: Cancel BH if not needed" which
>>
>>a) introduces pe
On Wed, Jul 13, 2016 at 1:45 PM, Kevin Wolf wrote:
> Am 13.07.2016 um 13:33 hat Roman Penyaev geschrieben:
>> Just to be sure that we are on the same page:
>>
>> 1. We have this commit "linux-aio: Cancel BH if not needed" which
>>
>>a) introduces pe
On Fri, Jul 15, 2016 at 11:58 AM, Paolo Bonzini wrote:
>
>
> On 15/07/2016 11:18, Roman Penyaev wrote:
>> Those 3 red spikes and a blue hill is what we have to focus on. The
>> blue hill at the right corner of the chart means that almost always the
>> ring buffe
On Fri, Jul 15, 2016 at 12:17 PM, Roman Penyaev
wrote:
> On Fri, Jul 15, 2016 at 11:58 AM, Paolo Bonzini wrote:
>>
>>
>> On 15/07/2016 11:18, Roman Penyaev wrote:
>>> Those 3 red spikes and a blue hill is what we have to focus on. The
>>> blue hill at t
On Fri, Jul 15, 2016 at 4:18 PM, Stefan Hajnoczi wrote:
> On Tue, Jul 12, 2016 at 04:12:42PM +0200, Roman Penyaev wrote:
>> On Tue, Jun 28, 2016 at 11:42 AM, Stefan Hajnoczi wrote:
>> > On Mon, Jun 27, 2016 at 08:36:19PM +0200, Roman Penyaev wrote:
>> >> On Jun 27,
On Fri, Jul 15, 2016 at 11:18 AM, Roman Penyaev
wrote:
> On Wed, Jul 13, 2016 at 1:45 PM, Kevin Wolf wrote:
>> Am 13.07.2016 um 13:33 hat Roman Penyaev geschrieben:
>>> Just to be sure that we are on the same page:
>>>
>>> 1. We have this commit "
On Tue, Jul 19, 2016 at 12:36 PM, Paolo Bonzini wrote:
>
>
> On 19/07/2016 12:25, Roman Pen wrote:
>> if (laiocb->co) {
>> -qemu_coroutine_enter(laiocb->co, NULL);
>> +if (laiocb->co == qemu_coroutine_self()) {
>> +laiocb->self_completed = true;
>
> No need for thi
On Tue, Jul 19, 2016 at 1:18 PM, Roman Penyaev
wrote:
> On Tue, Jul 19, 2016 at 12:36 PM, Paolo Bonzini wrote:
>>
>>
>> On 19/07/2016 12:25, Roman Pen wrote:
>>> if (laiocb->co) {
>>> -qemu_coroutine_enter(laiocb->co, NULL);
>&
On Tue, Jul 19, 2016 at 1:47 PM, Paolo Bonzini wrote:
>
>
> On 19/07/2016 13:44, Roman Penyaev wrote:
>>>> >>
>>>> >> Can this leave I/O stuck if in_queue > 0 && in_flight == 0 after the
>>>> >> return from qemu_laio_p
On Thu, Jun 1, 2017 at 3:15 PM, Stefan Hajnoczi wrote:
> On Wed, May 31, 2017 at 03:23:25PM +0200, Roman Penyaev wrote:
>> On Wed, May 31, 2017 at 3:06 PM, Stefan Hajnoczi wrote:
>> > On Tue, May 30, 2017 at 12:07:36PM +0200, Roman Pen wrote:
>> >> diff --git a/uti
On Thu, Jun 1, 2017 at 6:08 PM, Roman Pen
wrote:
[cut]
> Thread 12 (Thread 0x7f57f2ffd700 (LWP 56426)):
> #0 raise () from /lib/x86_64-linux-gnu/libc.so.6
> #1 abort () from /lib/x86_64-linux-gnu/libc.so.6
> #2 qemu_coroutine_enter (co=0x7f5804009af0) at qemu-coroutine.c:113
> #3 qemu_c
On Tue, Mar 14, 2017 at 11:21 AM, Paolo Bonzini wrote:
>
>
> On 14/03/2017 11:08, Roman Pen wrote:
>> For sure under corefile debugging it is not possible to invoke
>> any syscalls, like arch_prctl(), so avoid doing that. That will
>> simplify the script.
>
> Is the issue that start_thread only w
On Tue, May 30, 2017 at 11:35 AM, Paolo Bonzini wrote:
>
>
> On 30/05/2017 10:53, Roman Pen wrote:
>> The fix is obvious: use temporal queue and do not touch coroutine after
>> first qemu_coroutine_enter() is invoked.
>>
>> The issue is quite rare and happens every ~12 hours on very high IO load
>
On Wed, May 31, 2017 at 3:22 PM, Paolo Bonzini wrote:
>
>
> On 31/05/2017 15:06, Stefan Hajnoczi wrote:
>>> +
>>> +while ((next = QSIMPLEQ_FIRST(&tmp_queue_wakeup))) {
>>> +QSIMPLEQ_REMOVE_HEAD(&tmp_queue_wakeup, co_queue_next);
>>> qemu_coroutine_enter(next);
>>> }
>>>
On Wed, May 31, 2017 at 3:06 PM, Stefan Hajnoczi wrote:
> On Tue, May 30, 2017 at 12:07:36PM +0200, Roman Pen wrote:
>> diff --git a/util/qemu-coroutine-lock.c b/util/qemu-coroutine-lock.c
>> index 6328eed26bc6..d589d8c66d5e 100644
>> --- a/util/qemu-coroutine-lock.c
>> +++ b/util/qemu-coroutine-l
On Tue, May 30, 2017 at 1:35 PM, Fam Zheng wrote:
[cut]
> Reviewed-by: Fam Zheng
Do I need to resend the patch with 'reviewed-by' line? Or it is
already queued?
--
Roman
Hey Stefan,
On Tue, Sep 27, 2016 at 4:06 PM, Stefan Hajnoczi wrote:
> Commit 0ed93d84edabc7656f5c998ae1a346fe8b94ca54 ("linux-aio: process
> completions from ioq_submit()") added an optimization that processes
> completions each time ioq_submit() returns with requests in flight.
> This commit int
On Tue, Sep 27, 2016 at 5:25 PM, Stefan Hajnoczi wrote:
> On Tue, Sep 27, 2016 at 04:29:55PM +0200, Roman Penyaev wrote:
>> On Tue, Sep 27, 2016 at 4:06 PM, Stefan Hajnoczi wrote:
>> > Commit 0ed93d84edabc7656f5c998ae1a346fe8b94ca54 ("linux-aio: process
>> > compl
On Wed, Sep 28, 2016 at 5:01 AM, Fam Zheng wrote:
> On Tue, 09/27 19:55, Roman Penyaev wrote:
>> > The bug is 100% deterministic. Just boot up a guest with -drive
>> > format=qcow2,aio=native.
>>
>> It turns out to be that everything is broken. I started al
On Wed, Sep 28, 2016 at 11:34 AM, Fam Zheng wrote:
> On Wed, 09/28 11:14, Roman Penyaev wrote:
>> On Wed, Sep 28, 2016 at 5:01 AM, Fam Zheng wrote:
>> > On Tue, 09/27 19:55, Roman Penyaev wrote:
>> >> > The bug is 100% deterministic. Just boot up a guest wit
then it's
> necessary to call it again. Failure to do so can lead to hung I/O
> because the eventfd has already been cleared and the completion BH will
> not run again.
>
> This patch fixes the hang by calling io_getevents(2) again if the events
> array was totally full.
>
>
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
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 | 41 +-
chardev/char.c | 2 +-
chard
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-
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
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
>
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
`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
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
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
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
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 +--
communication to the virtio hvc
console.
New type of multiplexer `mux-be` actually is an alias for the same
`MuxChardev` struct, which uses same functions as for the original
`mux` type, but supports multiplexing N backends with 1 frontend.
Signed-off-by: Roman Penyaev
Cc: "Marc-André Lureau
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-options.hx | 46 +++
-off-by: Roman Penyaev
Cc: "Marc-André Lureau"
Cc: qemu-devel@nongnu.org
---
chardev/char-fe.c | 7 +++
chardev/char-mux.c | 12 ++--
chardev/char.c | 2 +-
chardev/chardev-internal.h | 2 +-
4 files changed, 11 insertions(+), 12 deletions(-)
di
will follow.
Signed-off-by: Roman Penyaev
Cc: "Marc-André Lureau"
Cc: qemu-devel@nongnu.org
---
chardev/char.c | 3 +++
include/chardev/char.h | 1 +
qapi/char.json | 9 -
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/chardev/char.c b/cha
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 | 217 +++
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
Roman Penyaev (5):
chardev/char: introduce `mux-be-id=ID` option and _MUX_
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 +++
/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/
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
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/
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@
` 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
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
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
/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
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
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
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 | 218 +++
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
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 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/
/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
` 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 | 14 ++
chardev/char-mux-be.c | 272
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-mux
`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
On Thu, Oct 10, 2024, 12:20 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
>> frontends attached. Th
| 9 +-
>> qemu-options.hx| 46 +++-
>> tests/unit/test-char.c | 217 ++++-
>> 8 files changed, 538 insertions(+), 51 deletions(-)
>>
>> Signed-off-by: Roman Penyaev
>> Cc: "Marc-André Lureau"
>> Cc: qemu-devel@nongnu.org
>>
>> --
>> 2.43.0
>>
>>
>
>
> --
> Marc-André Lureau
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
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,
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
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
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
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
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
`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
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-
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 ++--
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
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
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
>
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
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
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.
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
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
--
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
Hi,
Thanks for the review, I will try to come up with the next version of
this series.
On Wed, Sep 18, 2024 at 12:52 PM Marc-André Lureau
wrote:
[cut]
>
>
> Indeed, this double commas stuff is weird, I don't know that "trick". Is it
> used elsewhere and documented? I don't see a test in test-qe
/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/
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
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
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 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/
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@
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
/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
1 - 100 of 153 matches
Mail list logo