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/
Home Products Support Community News


Re: [Xen-devel] [PATCH] Qemu serial patch

To: Ian Pratt <m+Ian.Pratt@xxxxxxxxxxxx>, "Yang, Xiaowei" <xiaowei.yang@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Qemu serial patch
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Mon, 25 Sep 2006 08:57:11 +0100
Cc: Chris Carr <Chris.Carr@xxxxxxxxxxxxx>, "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>
Delivery-date: Mon, 25 Sep 2006 00:56:01 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <3AAA99889D105740BE010EB6D5A5A3B202A358@xxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcbcjNMapVSa1WgARTaJFcfhrmJz1QDmMrcwABSlqU0=
Thread-topic: [Xen-devel] [PATCH] Qemu serial patch
User-agent: Microsoft-Entourage/

On 24/9/06 23:13, "Ian Pratt" <m+Ian.Pratt@xxxxxxxxxxxx> wrote:

> -            qemu_chr_write(s->chr, &ch, 1);
> +            if (qemu_chr_write(s->chr, &ch, 1) == -1)
> +                fprintf(logfile, "serial write error\n");
>              s->thr_ipending = 1;
>              s->lsr |= UART_LSR_THRE;
>              s->lsr |= UART_LSR_TEMT;
> Doesn't the above mean we still drop the character? Shouldn't we be
> storing the character somewhere and retrying it later? We should
> probably also clear the tx ready bit (bit 5) in the UART's Line Status
> Register. We should then retry the write in ~100ms, and set the tx ready
> bit again.

There's not even any need to poll, if the serial fd is in the set of
writefd's. Buffering internally to some reasonable limit and then clearing
THRE until the fd appears in the pollset and some FIFO space is cleared is
the right thing to do.

 -- Keir

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>