On 04.01.2025 02:58, Denis Mukhin via B4 Relay wrote:
> From: Denis Mukhin <dmuk...@ford.com>

First: The title gives the impression that the field is never used (read)
right now. That's not the case.

> The code inspects d->is_console flag to decide whether the console focus
> should move to the domain with console after administrator uses <Ctrl+aaa>
> key combination to switch the console focus.

It's unclear whether this sentence describes what is the situation before
the patch, or what the patch changes things to. (The impression I'm getting
is that it's the latter.)

> --- a/xen/arch/arm/dom0less-build.c
> +++ b/xen/arch/arm/dom0less-build.c
> @@ -985,7 +985,6 @@ void __init create_domUs(void)
>              panic("Error initializing LLC coloring for domain %s (rc = 
> %d)\n",
>                    dt_node_name(node), rc);
>  
> -        d->is_console = true;
>          dt_device_set_used_by(node, d->domain_id);
>  
>          rc = construct_domU(d, node);

The flag having an existing user, what's the replacement of the setting of
it that you drop from here? Same question then goes for the places where
you set the flag anew.

> @@ -562,8 +584,19 @@ static void __serial_rx(char c)
>          /* Deliver input to the PV shim console. */
>          rc = consoled_guest_tx(c);
>  
> -    if ( rc )
> -        printk(KERN_ERR "d%pd: failed to process console input: %d\n", d, 
> rc);
> +    switch ( rc )
> +    {
> +    case 0:
> +        break;
> +    case -EBUSY:    /* Loopback mode */
> +    case -ENOSPC:   /* FIFO is full */
> +        printk(KERN_WARNING "d%pd: failed to process console input: %d\n", 
> d, rc);
> +        break;
> +    default:
> +        d->is_console = false;
> +        printk(KERN_ERR "d%pd: disabled console forwarding: %d\n", d, rc);
> +        break;
> +    }

Nit: Blank lines between non-fall-through case blocks please.

Jan

Reply via email to