From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37171) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vt9o3-0001Wj-27 for qemu-devel@nongnu.org; Wed, 18 Dec 2013 00:36:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vt9nq-0003xV-C8 for qemu-devel@nongnu.org; Wed, 18 Dec 2013 00:36:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:8728) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vt9nq-0003xC-4P for qemu-devel@nongnu.org; Wed, 18 Dec 2013 00:36:14 -0500 Date: Wed, 18 Dec 2013 11:05:47 +0530 From: Amit Shah Message-ID: <20131218053547.GB22209@grmbl.mre> References: <1387103197-2238-1-git-send-email-ghammer@redhat.com> <20131216203245.GD6582@grmbl.mre> <52B01562.60700@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52B01562.60700@redhat.com> Subject: Re: [Qemu-devel] [PATCH V4] char: restore read callback on a reattached (hotplug) chardev List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gal Hammer Cc: qemu-devel@nongnu.org, Anthony Liguori , Gerd Hoffmann On (Tue) 17 Dec 2013 [11:12:02], Gal Hammer wrote: > On 16/12/2013 22:32, Amit Shah wrote: > >On (Sun) 15 Dec 2013 [12:26:37], Gal Hammer wrote: > >>Fix a bug that was introduced in commit 386a5a1e. A removal of a device > >>set the chr handlers to NULL. However when the device is plugged back, > >>its read callback is not restored so data can't be transferred from the > >>host to the guest (e.g. via the virtio-serial port). > >> > >>https://bugzilla.redhat.com/show_bug.cgi?id=1027181 > >> > >>Signed-off-by: Gal Hammer > >> > >>--- > >> qemu-char.c | 17 +++++++++++++++-- > >> 1 file changed, 15 insertions(+), 2 deletions(-) > >> > >>V4: - Same as V3, but this time done right. > >> > >>V3: - fix a typo in comment. > >> - move the revision history after the "signed-off-by" tag. > >> > >>V2: - do not call chr_update_read_handler on device removal. > >> - add asserts to verify chr_update_read_handler is not called > >> with an assigned fd_in_tag to prevent fd leaks. > >> - update fd and udp backends' chr_update_read_handler function > >> so it won't remove fd_in to prevent a double release. > > > >Looks like you missed the pty backend. Can't blame you -- this > >chardev stuff is really messy. pty is doing is own handling + polling > >+ HUP detection, which really is equally applicable to tcp and udp as > >well. > > As far as I could tell the pty backend doesn't suffer from this > issue. That's why I didn't change anything there. pty_chr_update_read_handler() calls pty_chr_state(), which calls remove_fd_in_watch(). Amit