bitkeeper revision 1.895 (40a0e3db-NpIf7YeRmbz-zSrqfMekg)
authoriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Tue, 11 May 2004 14:31:55 +0000 (14:31 +0000)
committeriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Tue, 11 May 2004 14:31:55 +0000 (14:31 +0000)
Allow non-privleged domains to use "xprintk" (HYPERVISOR_console_io) in debug=y builds of Xen.
xprintk is very useful for debugging start-of-day problems in xenolinux -- it's often
useful to have printk call it directly instead of the usual console writing stuff.

xen/drivers/char/console.c
xenolinux-2.4.26-sparse/arch/xen/drivers/console/console.c

index b313f59b3a00c5ae2e84fa2ea20e0618b9835e8d..2744ed0c75f454e0328f4ab9c0c638d45568b453 100644 (file)
@@ -289,9 +289,11 @@ long do_console_io(int cmd, int count, char *buffer)
     char *kbuf;
     long  rc;
 
+#ifdef NDEBUG
     /* Only domain-0 may access the emrgency console. */
     if ( current->domain != 0 )
         return -EPERM;
+#endif
 
     switch ( cmd )
     {
index e01896385b5507854602a577ec3a0c40af675c26..3e7ce7866d838956f84bf0dbd4154705eac1975a 100644 (file)
@@ -86,6 +86,8 @@ static void kcons_write_dom0(
             count -= rc;
             s += rc;
         }
+       else
+           break;
     }
 }
 
@@ -124,12 +126,9 @@ asmlinkage int xprintk(const char *fmt, ...)
     va_start(args, fmt);
     printk_len = vsnprintf(printk_buf, sizeof(printk_buf), fmt, args);
     va_end(args);
-    
+
     /* Send the processed output directly to Xen. */
-    if ( start_info.flags & SIF_INITDOMAIN )
-        kcons_write_dom0(NULL, printk_buf, printk_len);
-    else
-        kcons_write(NULL, printk_buf, printk_len);
+    kcons_write_dom0(NULL, printk_buf, printk_len);
 
     return 0;
 }