WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] qemu 16550 uart: Fast-drop bursts of tran

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] qemu 16550 uart: Fast-drop bursts of transmitted characters to avoid
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 10 Dec 2007 03:10:07 -0800
Delivery-date: Mon, 10 Dec 2007 03:10:18 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1197128764 0
# Node ID 180e4a77e805c0a0b280e3b30d960f2feac2926d
# Parent  d4a3479e68ce0e7775759bd2dc94ced4ffe84eb6
qemu 16550 uart: Fast-drop bursts of transmitted characters to avoid
stalling due to a disconnected pipe or pty.
Signed-off-by: Trolle Selander <trolle.selander@xxxxxxxxx>
---
 tools/ioemu/hw/serial.c |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diff -r d4a3479e68ce -r 180e4a77e805 tools/ioemu/hw/serial.c
--- a/tools/ioemu/hw/serial.c   Fri Dec 07 18:24:33 2007 +0000
+++ b/tools/ioemu/hw/serial.c   Sat Dec 08 15:46:04 2007 +0000
@@ -359,7 +359,7 @@ static void serial_xmit(void *opaque) {
     SerialState *s = opaque;
     uint64_t new_xmit_ts = qemu_get_clock(vm_clock);
     
-    if ( s->tsr_retry == 0 ) {
+    if ( s->tsr_retry <= 0 ) {
         if (s->fcr & UART_FCR_FE) {
             s->tsr = fifo_get(s,XMIT_FIFO);
             if ( !s->xmit_fifo.count )
@@ -371,16 +371,22 @@ static void serial_xmit(void *opaque) {
     }
 
     if ( qemu_chr_write(s->chr, &s->tsr, 1) != 1 ) {
-        s->tsr_retry++;
-        if ( s->tsr_retry <= MAX_XMIT_RETRY ) {
+        if ( ( s->tsr_retry > 0 ) && ( s->tsr_retry <= MAX_XMIT_RETRY ) ) {
+            s->tsr_retry++;
             qemu_mod_timer(s->transmit_timer,  new_xmit_ts + 
s->char_transmit_time );
             return;
-        }
-    }
- 
-    s->tsr_retry = 0;
+        } else if ( s->poll_msl < 0 ) {
+            /* If we exceed MAX_XMIT_RETRY and the backend is not a real 
serial port, then
+            drop any further failed writes instantly, until we get one that 
goes through.
+            This is to prevent guests that log to unconnected pipes or pty's 
from stalling. */
+            s->tsr_retry = -1;
+        }
+    }
+    else {
+        s->tsr_retry = 0;
+    }
+
     s->last_xmit_ts = qemu_get_clock(vm_clock);
-
     if ( !(s->lsr & UART_LSR_THRE) )
         qemu_mod_timer(s->transmit_timer, s->last_xmit_ts + 
s->char_transmit_time );
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] qemu 16550 uart: Fast-drop bursts of transmitted characters to avoid, Xen patchbot-unstable <=