From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TG6Zd-0007hR-MS for qemu-devel@nongnu.org; Mon, 24 Sep 2012 07:11:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TG6Zc-0008AU-GP for qemu-devel@nongnu.org; Mon, 24 Sep 2012 07:11:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TG6Zc-0008AK-8J for qemu-devel@nongnu.org; Mon, 24 Sep 2012 07:11:36 -0400 From: Orit Wasserman Date: Mon, 24 Sep 2012 13:11:10 +0200 Message-Id: <1348485070-8190-5-git-send-email-owasserm@redhat.com> In-Reply-To: <1348485070-8190-1-git-send-email-owasserm@redhat.com> References: <1348485070-8190-1-git-send-email-owasserm@redhat.com> Subject: [Qemu-devel] [PATCH v5 4/4] Clear handler only for valid fd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, aliguori@us.ibm.com, quintela@redhat.com, armbru@redhat.com, mst@redhat.com, mdroth@linux.vnet.ibm.com, lcapitulino@redhat.com, Orit Wasserman , pbonzini@redhat.com, akong@redhat.com Signed-off-by: Orit Wasserman --- migration.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/migration.c b/migration.c index 1edeec5..22a05c4 100644 --- a/migration.c +++ b/migration.c @@ -240,7 +240,9 @@ static int migrate_fd_cleanup(MigrationState *s) { int ret = 0; - qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL); + if (s->fd != -1) { + qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL); + } if (s->file) { DPRINTF("closing file\n"); -- 1.7.7.6