From 3f0681b618f122d1bb4b594e553d77c44840d5c9 Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Mon, 10 Jan 2011 22:20:06 +0200 Subject: [PATCH] kvm,8250: Fix ->counter clearing We need to reset the counter to zero before we inject an interrupt to the guest. Signed-off-by: Pekka Enberg --- tools/kvm/8250-serial.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/kvm/8250-serial.c b/tools/kvm/8250-serial.c index 834c523f4cff..16910e35dc16 100644 --- a/tools/kvm/8250-serial.c +++ b/tools/kvm/8250-serial.c @@ -105,6 +105,7 @@ void serial8250__interrupt(struct kvm *self) /* Only send an IRQ if there's work to do. */ if (new_iir) { + dev->counter = 0; dev->iir = new_iir; kvm__irq_line(self, dev->irq, 0); kvm__irq_line(self, dev->irq, 1); @@ -164,10 +165,8 @@ static bool serial8250_out(struct kvm *self, uint16_t port, void *data, int size } fflush(stdout); - if (dev->counter++ > 10) { + if (dev->counter++ > 10) dev->iir = UART_IIR_NO_INT; - dev->counter = 0; - } break; } -- 2.39.5