Received: from eggs.gnu.org ([2001:4830:134:3::10]:46166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wuc4p-0007OY-B4 for qemu-devel@nongnu.org; Wed, 11 Jun 2014 02:32:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wuc4j-0002Db-77 for qemu-devel@nongnu.org; Wed, 11 Jun 2014 02:32:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26516) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wuc4i-0002DQ-T3 for qemu-devel@nongnu.org; Wed, 11 Jun 2014 02:31:57 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5B6Vt1U019503 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 11 Jun 2014 02:31:56 -0400 Date: Wed, 11 Jun 2014 14:32:11 +0800 From: Fam Zheng Message-ID: <20140611063211.GF5448@T430.nay.redhat.com> References: <1401813551-6667-1-git-send-email-pbonzini@redhat.com> <1401813551-6667-4-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1401813551-6667-4-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH 3/6] qemu-char: move pty_chr_update_read_handler around List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, kraxel@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, lcapitulino@redhat.com On Tue, 06/03 18:39, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini Reviewed-by: Fam Zheng > --- > qemu-char.c | 32 ++++++++++++++++---------------- > 1 file changed, 16 insertions(+), 16 deletions(-) > > diff --git a/qemu-char.c b/qemu-char.c > index 2bda2fb..b478a3d 100644 > --- a/qemu-char.c > +++ b/qemu-char.c > @@ -1055,6 +1055,22 @@ static void pty_chr_rearm_timer(CharDriverState *chr, int ms) > } > } > > +static void pty_chr_update_read_handler(CharDriverState *chr) > +{ > + PtyCharDriver *s = chr->opaque; > + GPollFD pfd; > + > + pfd.fd = g_io_channel_unix_get_fd(s->fd); > + pfd.events = G_IO_OUT; > + pfd.revents = 0; > + g_poll(&pfd, 1, 0); > + if (pfd.revents & G_IO_HUP) { > + pty_chr_state(chr, 0); > + } else { > + pty_chr_state(chr, 1); > + } > +} > + > static int pty_chr_write(CharDriverState *chr, const uint8_t *buf, int len) > { > PtyCharDriver *s = chr->opaque; > @@ -1107,22 +1123,6 @@ static gboolean pty_chr_read(GIOChannel *chan, GIOCondition cond, void *opaque) > return TRUE; > } > > -static void pty_chr_update_read_handler(CharDriverState *chr) > -{ > - PtyCharDriver *s = chr->opaque; > - GPollFD pfd; > - > - pfd.fd = g_io_channel_unix_get_fd(s->fd); > - pfd.events = G_IO_OUT; > - pfd.revents = 0; > - g_poll(&pfd, 1, 0); > - if (pfd.revents & G_IO_HUP) { > - pty_chr_state(chr, 0); > - } else { > - pty_chr_state(chr, 1); > - } > -} > - > static void pty_chr_state(CharDriverState *chr, int connected) > { > PtyCharDriver *s = chr->opaque; > -- > 1.8.3.1 > >