From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPzJA-0000gL-3i for qemu-devel@nongnu.org; Wed, 10 Apr 2013 13:59:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPzJ9-0000vk-15 for qemu-devel@nongnu.org; Wed, 10 Apr 2013 13:59:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32436) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPzJ8-0000vg-QP for qemu-devel@nongnu.org; Wed, 10 Apr 2013 13:59:42 -0400 Date: Wed, 10 Apr 2013 23:29:34 +0530 From: Amit Shah Message-ID: <20130410175934.GA5213@amit.redhat.com> References: <1365600207-21685-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1365600207-21685-1-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH] qemu-char: another io_add_watch_poll fix List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Hans de Goede , aliguori@us.ibm.com, qemu-devel@nongnu.org On (Wed) 10 Apr 2013 [15:23:27], Paolo Bonzini wrote: > After attaching the source, we have to remove the reference we hold > to it, because we do not hold anymore a pointer to the source. > > If we do not do this, removing the source will not finalize it and > will not drop the "real" I/O watch source. > > This showed up when backporting the new flow control patches to older > versions of QEMU that still used select. The whole select then failed > with EBADF (poll instead will reporting POLLNVAL on a single pollfd) > and QEMU froze. This patch doesn't apply directly to master, applies with some fuzz. However, this patch causes qemu freeze. My testcase is: Open chardev on host Write something to a virtserialport in guest Close chardev on host Keep writing to virtserialport in guest When I apply the patch to the old qemu version with select, that starts working fine with the testcase above. There's a slight difference in my old qemu tree, I have Hans's "virtio-console: Remove any pending watches on close" patch applied, which makes use of the tag obtained on adding the watch. That patch hasn't found its way to master yet, but it should go in soon. Amit