From 7d5aab23a584d593bcab4435df5cd6e0fc534bbd Mon Sep 17 00:00:00 2001 From: Jean Guyader Date: Mon, 13 Oct 2008 14:02:33 +0100 Subject: [PATCH] hvm-log-to-dom0 --- hw/xen_platform.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/hw/xen_platform.c b/hw/xen_platform.c index ebbad317..38eec0bb 100644 --- a/hw/xen_platform.c +++ b/hw/xen_platform.c @@ -68,6 +68,20 @@ static void xen_platform_ioport_writeb(void *opaque, uint32_t addr, uint32_t val d->platform_flags = val & PFFLAG_ROM_LOCK; break; } + case 8: + { + static char log_buffer[4096]; + static int log_buffer_off; + if (val == '\n' || log_buffer_off == sizeof(log_buffer) - 1) { + /* Flush buffer */ + log_buffer[log_buffer_off] = 0; + fprintf(logfile, "%s\n", log_buffer); + log_buffer_off = 0; + break; + } + log_buffer[log_buffer_off++] = val; + } + break; default: break; } -- 2.39.5