[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/6] serial: separate serial_xmit and serial_wat
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 3/6] serial: separate serial_xmit and serial_watch_cb |
Date: |
Wed, 22 Jun 2016 17:14:27 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 |
On 22/06/2016 17:09, Dr. David Alan Gilbert wrote:
> > -static gboolean serial_xmit(GIOChannel *chan, GIOCondition cond, void
> > *opaque)
> > +static gboolean serial_watch_cb(GIOChannel *chan, GIOCondition cond,
> > + void *opaque)
> > {
> > SerialState *s = opaque;
> > + serial_xmit(s);
> > + return FALSE;
> > +}
>
> Yes, with a side question.
> We register this with G_IO_OUT|G_IO_HUP but don't check the cond, what's this
> code supposed to do if it gets a HUP?
It will attempt again to write, which will fail (see pty_chr_write);
then attempt to add a watch again, which this time should return 0 (see
pty_chr_add_watch). The outcome is that tsr_retry is reset to 0.
Thanks,
Paolo
> Since we didn't do anything with cond before either:
>
> Reviewed-by: Dr. David Alan Gilbert <address@hidden>
>
>