diff mbox series

[v2,14/35] xen/console: rename switch_serial_input() to console_find_owner()

Message ID 20241205-vuart-ns8250-v1-14-e9aa923127eb@ford.com (mailing list archive)
State New
Headers show
Series Introduce NS8250 UART emulator | expand

Commit Message

Denis Mukhin via B4 Relay Dec. 6, 2024, 4:41 a.m. UTC
From: Denis Mukhin <dmukhin@ford.com>

Updated the name to highlight the logic of selection the physical console
owner: existing code does not switch only serial console, it also switches
video console and debugging console (debug I/O port and console hypercall).

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
 xen/drivers/char/console.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jan Beulich Dec. 10, 2024, 2:13 p.m. UTC | #1
On 06.12.2024 05:41, Denis Mukhin via B4 Relay wrote:
> From: Denis Mukhin <dmukhin@ford.com>
> 
> Updated the name to highlight the logic of selection the physical console
> owner: existing code does not switch only serial console, it also switches
> video console and debugging console (debug I/O port and console hypercall).

I'm especially surprised you mention "video console" here. Afaics all of
this is only about console _input_, and no input comes from a video device.
Arguably "serial" in the original name is too narrow now. Yet "input"
continues to be quite appropriate.

Jan
Roger Pau Monné Dec. 11, 2024, 5:22 p.m. UTC | #2
On Tue, Dec 10, 2024 at 03:13:20PM +0100, Jan Beulich wrote:
> On 06.12.2024 05:41, Denis Mukhin via B4 Relay wrote:
> > From: Denis Mukhin <dmukhin@ford.com>
> > 
> > Updated the name to highlight the logic of selection the physical console
> > owner: existing code does not switch only serial console, it also switches
> > video console and debugging console (debug I/O port and console hypercall).
> 
> I'm especially surprised you mention "video console" here. Afaics all of
> this is only about console _input_, and no input comes from a video device.
> Arguably "serial" in the original name is too narrow now. Yet "input"
> continues to be quite appropriate.

switch_console_input() maybe? switch_console_input_target() even?

I think the switch is also relevant, as it shuffles the input around,
console_find_owner() doesn't seem to convey that meaning.

Thanks, Roger.
diff mbox series

Patch

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 01fcbd5581d11f8f4f2b23592255b5c744430a3e..f8a7db385c9525cabc69ceb1a84d73f57863aa45 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -485,7 +485,7 @@  struct domain *rcu_lock_domain_console_owner(void)
 }
 #endif
 
-static void switch_serial_input(void)
+static void console_find_owner(void)
 {
     unsigned int next_rx = console_rx;
 
@@ -588,7 +588,7 @@  static void cf_check serial_rx(char c)
         /* We eat CTRL-<switch_char> in groups of 3 to switch console input. */
         if ( ++switch_code_count == 3 )
         {
-            switch_serial_input();
+            console_find_owner();
             switch_code_count = 0;
         }
         return;
@@ -1128,7 +1128,7 @@  void __init console_endboot(void)
                             "toggle host/guest log level adjustment", 0);
 
     /* Serial input is directed to DOM0 by default. */
-    switch_serial_input();
+    console_find_owner();
 }
 
 int __init console_has(const char *device)