From patchwork Mon Sep 24 11:11:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Orit Wasserman X-Patchwork-Id: 186360 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 019CC2C0080 for ; Mon, 24 Sep 2012 21:11:55 +1000 (EST) Received: from localhost ([::1]:55718 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TG6Zq-0007rL-Rq for incoming@patchwork.ozlabs.org; Mon, 24 Sep 2012 07:11:50 -0400 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 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8OBBY2n030542 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 24 Sep 2012 07:11:34 -0400 Received: from dhcp-1-120.tlv.redhat.com (vpn-203-114.tlv.redhat.com [10.35.203.114]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q8OBBGfV006566; Mon, 24 Sep 2012 07:11:30 -0400 From: Orit Wasserman To: qemu-devel@nongnu.org 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> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 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 Subject: [Qemu-devel] [PATCH v5 4/4] Clear handler only for valid fd X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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");