|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 05/22] char: optionally redirect {, g}printk output to QEMU debug log
From: Matt Wilson <msw@xxxxxxxxxx>
When using Vixen, it is helpful to get the Xen messages in a
separate channel than the console output. Add an option to
output to the QEMU backdoor logging port.
Signed-off-by: Matt Wilson <msw@xxxxxxxxxx>
Signed-off-by: Anthony Liguori <aliguori@xxxxxxxxxx>
---
xen/drivers/char/console.c | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 19d0e74..b9412c5 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -85,6 +85,11 @@ static int __read_mostly sercon_handle = -1;
static DEFINE_SPINLOCK(console_lock);
+/* send all printk output to QEMU debug log. Input does not change,
+ * nor does dom0 output.
+ */
+static bool_t __read_mostly qemu_debug = false;
+
/*
* To control the amount of printing, thresholds are added.
* These thresholds correspond to the XENLOG logging levels.
@@ -564,10 +569,21 @@ static void __putstr(const char *str)
{
ASSERT(spin_is_locked(&console_lock));
- sercon_puts(str);
- video_puts(str);
+ if ( qemu_debug )
+ {
+ char c;
+ while ( (c = *str++) != '\0' )
+ {
+ outb(c, 0x12);
+ }
+ }
+ else
+ {
+ sercon_puts(str);
+ video_puts(str);
- conring_puts(str);
+ conring_puts(str);
+ }
if ( !console_locks_busted )
tasklet_schedule(¬ify_dom0_con_ring_tasklet);
@@ -762,6 +778,8 @@ void __init console_init_preirq(void)
p++;
if ( !strncmp(p, "vga", 3) )
video_init();
+ else if ( !strncmp(p, "qemu", 4) )
+ qemu_debug = true;
else if ( !strncmp(p, "none", 4) )
continue;
else if ( (sh = serial_parse_handle(p)) >= 0 )
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |