From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36701) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFjrR-0001MW-VL for qemu-devel@nongnu.org; Wed, 22 Jun 2016 11:14:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFjrL-0001Jl-W8 for qemu-devel@nongnu.org; Wed, 22 Jun 2016 11:14:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35628) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFjrL-0001JK-Qk for qemu-devel@nongnu.org; Wed, 22 Jun 2016 11:14:31 -0400 References: <1466432945-28682-1-git-send-email-pbonzini@redhat.com> <1466432945-28682-4-git-send-email-pbonzini@redhat.com> <20160622150920.GD6604@work-vm> From: Paolo Bonzini Message-ID: Date: Wed, 22 Jun 2016 17:14:27 +0200 MIME-Version: 1.0 In-Reply-To: <20160622150920.GD6604@work-vm> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/6] serial: separate serial_xmit and serial_watch_cb List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert" Cc: qemu-devel@nongnu.org, bcketchum@gmail.com 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 > >