From: iap10@labyrinth.cl.cam.ac.uk Date: Tue, 11 May 2004 14:31:55 +0000 (+0000) Subject: bitkeeper revision 1.895 (40a0e3db-NpIf7YeRmbz-zSrqfMekg) X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~18226 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a8e33843ee074cd479e0cb69a7e379587cdca5bb;p=xen.git bitkeeper revision 1.895 (40a0e3db-NpIf7YeRmbz-zSrqfMekg) 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. --- diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index b313f59b3a..2744ed0c75 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -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 ) { diff --git a/xenolinux-2.4.26-sparse/arch/xen/drivers/console/console.c b/xenolinux-2.4.26-sparse/arch/xen/drivers/console/console.c index e01896385b..3e7ce7866d 100644 --- a/xenolinux-2.4.26-sparse/arch/xen/drivers/console/console.c +++ b/xenolinux-2.4.26-sparse/arch/xen/drivers/console/console.c @@ -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; }