qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 30/67] ui/vc: fold text_console_do_init() in vc_chr_open()


From: Daniel P . Berrangé
Subject: Re: [PATCH 30/67] ui/vc: fold text_console_do_init() in vc_chr_open()
Date: Fri, 1 Sep 2023 15:34:58 +0100
User-agent: Mutt/2.2.9 (2022-11-12)

On Wed, Aug 30, 2023 at 01:38:04PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  ui/console.c | 80 ++++++++++++++++++++--------------------------------
>  1 file changed, 31 insertions(+), 49 deletions(-)

> @@ -2612,12 +2570,36 @@ static void vc_chr_open(Chardev *chr,
>      s->chr = chr;
>      drv->console = s;
>  
> -    text_console_do_init(chr);
> +    fifo8_create(&s->out_fifo, 16);
>  
> -    /* console/chardev init sometimes completes elsewhere in a 2nd
> -     * stage, so defer OPENED events until they are fully initialized
> -     */
> -    *be_opened = false;
> +    s->total_height = DEFAULT_BACKSCROLL;
> +    if (QEMU_CONSOLE(s)->scanout.kind != SCANOUT_SURFACE) {
> +        if (active_console && active_console->scanout.kind == 
> SCANOUT_SURFACE) {
> +            g_width = qemu_console_get_width(active_console, g_width);
> +            g_height = qemu_console_get_height(active_console, g_height);
> +        }
> +        QEMU_CONSOLE(s)->surface = qemu_create_displaysurface(g_width, 
> g_height);
> +        QEMU_CONSOLE(s)->scanout.kind = SCANOUT_SURFACE;
> +    }
> +
> +    QEMU_CONSOLE(s)->hw_ops = &text_console_ops;
> +    QEMU_CONSOLE(s)->hw = s;

It feels like it would be worth having a local variable

"QemuConsole *c = QEMU_CONSOLE(s)"

to replace the many repeated casts.

Appreciate you merely moved existing code though, so either way

  Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




reply via email to

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