qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-stable] [Qemu-devel] [PATCH] mux: fix ctrl-a b again


From: Marc-André Lureau
Subject: Re: [Qemu-stable] [Qemu-devel] [PATCH] mux: fix ctrl-a b again
Date: Wed, 18 Apr 2018 13:35:35 +0200

Hi

On Wed, Apr 18, 2018 at 12:55 PM, Paolo Bonzini <address@hidden> wrote:
> On 18/04/2018 12:36, Marc-André Lureau wrote:
>>
>> +            if (chr == NULL || chr->be) {
>> +                name = g_strdup_printf("discarding-serial%d", i);
>> +                chr = qemu_chr_new(name, "null");
>> +            } else {
>> +                name = g_strdup_printf("serial%d", i);
>> +            }
>>
>> Why do you check if chr->be ? In case of a mux chardev, it may already
>> have an active frontend (yeah be is CharBackend which is the frontend,
>> I still can't grasp that either, please Paolo change your mind! ;).
>
> CharBackend is not the frontend, it is *used* by the front-end.  It is
> the qemu_chr_* functions that are named wrong (they're named according
> to the user rather than the recipient).

If I follow you and the naming, you have this in mind:

- Chardev: stdio, mux, ringbuf, pty, file, null etc..
- CharBackend: the "user" end
- frontend: the "user"

It is quite confusing to me that CharBackend is for the "user"
frontend, and the backend of Chardev. You have to switch your mind
depending on the context or the point of view.

 I'd rather use that terminology:

- ChardevBackend: stdio, mux, ringbuf, pty, file, null etc..
- CharFrontend: the "user" end
- frontend the "user"

This way, there is only one direction from backend to frontend
(regardless of the point of view from chardev to frontend)

And rename struct and functions accordingly.

Do you have another proposal to simplify the current situation?

-- 
Marc-André Lureau



reply via email to

[Prev in Thread] Current Thread [Next in Thread]