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.
char *kbuf;
long rc;
+#ifdef NDEBUG
/* Only domain-0 may access the emrgency console. */
if ( current->domain != 0 )
return -EPERM;
+#endif
switch ( cmd )
{
count -= rc;
s += rc;
}
+ else
+ break;
}
}
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;
}