qemu-devel
[Top][All Lists]
Advanced

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

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


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [PATCH] mux: fix ctrl-a b again
Date: Wed, 18 Apr 2018 11:32:36 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

Hi Marc-André,

On 04/18/2018 07:36 AM, Marc-André Lureau wrote:
> In  commit cd9526ab7c04f2c32c63340b04401f6ed25682b9
> Author: Philippe Mathieu-Daudé <address@hidden>
> Date:   Thu Mar 8 23:39:32 2018 +0100
> 
>     hw/isa/superio: Factor out the serial code from pc87312.c
> 
> You changed from:
> 
> -            if (chr == NULL) {
> -                snprintf(name, sizeof(name), "ser%d", i);
> -                chr = qemu_chr_new(name, "null");
> -            }
> 
> to:
> 
> +            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! ;).
> And this is the job for a mux chardev, handling several frontends.

I was afraid this refactor could be related.

IIRC I had troubles running "qemu-system-alpha -append console=srm" but
I tried again with/without the chr->be check and it works fine...

Anyway the new code is buggy, this is wrong (simplified):

 if (chr->be) chr = qemu_chr_new(name, "null");

> 
> Furthermore, there is a better API for checking the limit of a
> chardev: qemu_chr_is_busy(). Accessing char/fe internal structure
> should warn you something could be done better.

This method is static (unexposed).



reply via email to

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