[XEN] Xen always relinquishes VGA console to domain0 when domain0
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 20 Jun 2006 17:51:46 +0000 (18:51 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 20 Jun 2006 17:51:46 +0000 (18:51 +0100)
starts to boot (previous behaviour looked for console=tty0 on
dom0's command line). To prevent this 'console=vga[keep]' must
be specified.
Signed-off-by: Keir Fraser <keir@xensource.com>
docs/src/user.tex
xen/arch/ia64/xen/domain.c
xen/arch/ia64/xen/xensetup.c
xen/arch/x86/setup.c
xen/drivers/char/console.c
xen/include/xen/console.h

index abbc109be270cce5c1287e3ed0f3da029fefb1ee..17f54020c127cc3b7993cdfb6c350647a30979a8 100644 (file)
@@ -1972,7 +1972,8 @@ editing \path{grub.conf}.
 \item [ console=$<$specifier list$>$ ] Specify the destination for Xen
   console I/O.  This is a comma-separated list of, for example:
   \begin{description}
-  \item[ vga ] Use VGA console and allow keyboard input.
+  \item[ vga ] Use VGA console (only until domain 0 boots, unless {\bf
+  vga[keep] } is specified).
   \item[ com1 ] Use serial port com1.
   \item[ com2H ] Use serial port com2. Transmitted chars will have the
     MSB set. Received chars must have MSB set.
index e42b3249debec9281ef24fd81a6b735f1f2bcacf..1d850330612430765dedd207139e3a32813c6f44 100644 (file)
@@ -855,9 +855,7 @@ int construct_dom0(struct domain *d,
        sprintf(si->magic, "xen-%i.%i-ia64", XEN_VERSION, XEN_SUBVERSION);
        si->nr_pages     = max_pages;
 
-       /* Give up the VGA console if DOM0 is configured to grab it. */
-       if (cmdline != NULL)
-           console_endboot(strstr(cmdline, "tty0") != NULL);
+       console_endboot();
 
        printk("Dom0: 0x%lx\n", (u64)dom0);
 
index 0ab92a08930a7d7272d887ac8ee18576d7b20a44..0f64691f4b7150d183e67a208b73a20957a5c371 100644 (file)
@@ -511,9 +511,8 @@ printk("About to call domain_create()\n");
 printk("About to call init_trace_bufs()\n");
     init_trace_bufs();
 
-    /* Give up the VGA console if DOM0 is configured to grab it. */
 #ifdef CONFIG_XEN_CONSOLE_INPUT        /* CONFIG_SERIAL_8250_CONSOLE=n in dom0! */
-    console_endboot(cmdline && strstr(cmdline, "tty0"));
+    console_endboot();
 #endif
 
     domain0_ready = 1;
index 01a6ab87222fb8f0986bab5f8707c71bb170379c..b78bcb21b853f29fe0fc4bb742cd0566b9367b81 100644 (file)
@@ -598,8 +598,7 @@ void __init __start_xen(multiboot_info_t *mbi)
 
     init_trace_bufs();
 
-    /* Give up the VGA console if DOM0 is configured to grab it. */
-    console_endboot(cmdline && strstr(cmdline, "tty0"));
+    console_endboot();
 
     /* Hide UART from DOM0 if we're using it */
     serial_endboot();
index bbb9f89a33aaa3f73a6efad2fac3d101ae00cefc..309411b387b240a1a1fb2bef0b204ff790f80e87 100644 (file)
@@ -476,7 +476,11 @@ void init_console(void)
         if ( strncmp(p, "com", 3) == 0 )
             sercon_handle = serial_parse_handle(p);
         else if ( strncmp(p, "vga", 3) == 0 )
+        {
             vgacon_enabled = 1;
+            if ( strncmp(p+3, "[keep]", 6) == 0 )
+                vgacon_enabled++;
+        }
     }
 
     init_vga();
@@ -502,7 +506,7 @@ void init_console(void)
     }
 }
 
-void console_endboot(int disable_vga)
+void console_endboot(void)
 {
     int i, j;
 
@@ -532,8 +536,12 @@ void console_endboot(int disable_vga)
         printk("\n");
     }
 
-    if ( disable_vga )
-        vgacon_enabled = 0;
+    if ( vgacon_enabled )
+    {
+        vgacon_enabled--;
+        printk("Xen is %s VGA console.\n",
+               vgacon_enabled ? "keeping" : "relinquishing");
+    }
 
     /*
      * If user specifies so, we fool the switch routine to redirect input
index b7232f305fcfa767b1f6ab63c132b074ecb7b596..de95b7f769f021415237b21a04388f1eeb9fbdca 100644 (file)
@@ -15,7 +15,7 @@ void set_printk_prefix(const char *prefix);
 long read_console_ring(XEN_GUEST_HANDLE(char), u32 *, int);
 
 void init_console(void);
-void console_endboot(int disable_vga);
+void console_endboot(void);
 
 void console_force_unlock(void);
 void console_force_lock(void);