From db34045c543bc4fa5b801f8aa4339e2c1e1ba1a6 Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Thu, 24 Mar 2011 18:56:02 +0200 Subject: [PATCH] kvm tools, 8250: Don't set the UART_LSR_OE bit User input is buffered anyway, so it's pointless to set the UART_LSR_OE bit. Instead, wait for the guest kernel to consume the current input and send a new character when the guest is ready. This fixes the following warnings in guest kernels: [ 207.485000] ttyS0: 1 input overrun(s) Reported-by: Asias He Signed-off-by: Pekka Enberg --- 8250-serial.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/8250-serial.c b/8250-serial.c index 7aea383..232f6e8 100644 --- a/8250-serial.c +++ b/8250-serial.c @@ -77,6 +77,9 @@ static void serial8250__receive(struct kvm *self, struct serial8250_device *dev) { int c; + if (dev->lsr & UART_LSR_DR) + return; + if (!is_readable(fileno(stdin))) return; @@ -84,9 +87,6 @@ static void serial8250__receive(struct kvm *self, struct serial8250_device *dev) if (c < 0) return; - if (dev->lsr & UART_LSR_DR) - dev->lsr |= UART_LSR_OE; - dev->rbr = c; dev->lsr |= UART_LSR_DR; }