Received: from eggs.gnu.org ([208.118.235.92]:59564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TG6vo-0005GJ-Pe for qemu-devel@nongnu.org; Mon, 24 Sep 2012 07:34:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TG6vk-0007GI-9w for qemu-devel@nongnu.org; Mon, 24 Sep 2012 07:34:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59510) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TG6vk-0007G8-2W for qemu-devel@nongnu.org; Mon, 24 Sep 2012 07:34:28 -0400 From: Markus Armbruster References: <1348411747-29804-1-git-send-email-owasserm@redhat.com> <1348411747-29804-5-git-send-email-owasserm@redhat.com> <87d31bsqj4.fsf@blackfin.pond.sub.org> <50602EC8.5080609@redhat.com> <5060308C.1060402@redhat.com> Date: Mon, 24 Sep 2012 13:34:23 +0200 In-Reply-To: <5060308C.1060402@redhat.com> (Paolo Bonzini's message of "Mon, 24 Sep 2012 12:06:04 +0200") Message-ID: <87r4prk62o.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v4 4/4] Clear handler only for valid fd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, aliguori@us.ibm.com, quintela@redhat.com, mst@redhat.com, mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org, Orit Wasserman , lcapitulino@redhat.com, akong@redhat.com Paolo Bonzini writes: > Il 24/09/2012 11:58, Orit Wasserman ha scritto: >>>> >> if (s->fd != -1) { >>>> >> + qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL); >>>> >> close(s->fd); >>>> >> s->fd = -1; >>>> >> } >>> > >>> > As far as I can see, qemu_set_fd_handler2() treats invalid file >>> > descriptor -1 just like any other. If it's in io_handlers, it gets >>> > deleted, else it's a nop. Thus, the old code works. >> Not any more, there was an assert(fd >=0) added in commit >> bbdd2ad0814ea0911076419ea21b7957505cf1cc >> recently. >> >>> > I'm not sufficiently familiar with the migration code to judge whether >>> > moving the handler reset down is safe. >>> > >> I can keep the call in the same location if you think it is safer. I have no idea, and... > I think it's okay as you did, given how the code looks like now. ... I'm prepared to take Paolo's word for it. [...]