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

[Xen-changelog] [xen-unstable] [XEN] Add a warning banner when 'sync_console' is used. Make it



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 06b10ad218f450732d9ed2e694b11f403edffd46
# Parent  69f7e0ea2985e6a8bd013740e8d76ad94de8e07b
[XEN] Add a warning banner when 'sync_console' is used. Make it
very obvious and mildly annoying.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/common/kernel.c        |    5 +++--
 xen/drivers/char/console.c |   24 ++++++++++++++++++++++++
 xen/include/xen/lib.h      |    1 +
 3 files changed, 28 insertions(+), 2 deletions(-)

diff -r 69f7e0ea2985 -r 06b10ad218f4 xen/common/kernel.c
--- a/xen/common/kernel.c       Tue Jun 20 17:04:13 2006 +0100
+++ b/xen/common/kernel.c       Tue Jun 20 18:19:07 2006 +0100
@@ -96,10 +96,11 @@ char *print_tainted(char *str)
 {
     if ( tainted )
     {
-        snprintf(str, TAINT_STRING_MAX_LEN, "Tainted: %c%c%c",
+        snprintf(str, TAINT_STRING_MAX_LEN, "Tainted: %c%c%c%c",
                  tainted & TAINT_UNSAFE_SMP ? 'S' : ' ',
                  tainted & TAINT_MACHINE_CHECK ? 'M' : ' ',
-                 tainted & TAINT_BAD_PAGE ? 'B' : ' ');
+                 tainted & TAINT_BAD_PAGE ? 'B' : ' ',
+                 tainted & TAINT_SYNC_CONSOLE ? 'C' : ' ');
     }
     else
     {
diff -r 69f7e0ea2985 -r 06b10ad218f4 xen/drivers/char/console.c
--- a/xen/drivers/char/console.c        Tue Jun 20 17:04:13 2006 +0100
+++ b/xen/drivers/char/console.c        Tue Jun 20 18:19:07 2006 +0100
@@ -497,12 +497,36 @@ void init_console(void)
     if ( opt_sync_console )
     {
         serial_start_sync(sercon_handle);
+        add_taint(TAINT_SYNC_CONSOLE);
         printk("Console output is synchronous.\n");
     }
 }
 
 void console_endboot(int disable_vga)
 {
+    int i;
+
+    if ( opt_sync_console )
+    {
+        printk("**********************************************\n");
+        printk("******* WARNING: CONSOLE OUTPUT IS SYCHRONOUS\n");
+        printk("******* This option is intended to aid debugging "
+               "of Xen by ensuring\n");
+        printk("******* that all output is synchronously delivered "
+               "on the serial line.\n");
+        printk("******* However it can introduce SIGNIFICANT latencies "
+               "and affect\n");
+        printk("******* timekeeping. It is NOT recommended for "
+               "production use!\n");
+        printk("**********************************************\n");
+        for ( i = 0; i < 3; i++ )
+        {
+            printk("%d... ", 3-i);
+            mdelay(1000);
+        }
+        printk("\n");
+    }
+
     if ( disable_vga )
         vgacon_enabled = 0;
 
diff -r 69f7e0ea2985 -r 06b10ad218f4 xen/include/xen/lib.h
--- a/xen/include/xen/lib.h     Tue Jun 20 17:04:13 2006 +0100
+++ b/xen/include/xen/lib.h     Tue Jun 20 18:19:07 2006 +0100
@@ -82,6 +82,7 @@ unsigned long long parse_size_and_unit(c
 #define TAINT_UNSAFE_SMP                (1<<0)
 #define TAINT_MACHINE_CHECK             (1<<1)
 #define TAINT_BAD_PAGE                  (1<<2)
+#define TAINT_SYNC_CONSOLE              (1<<3)
 extern int tainted;
 #define TAINT_STRING_MAX_LEN            20
 extern char *print_tainted(char *str);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.