From patchwork Tue Nov 1 19:20:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 123122 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7444EB6F84 for ; Wed, 2 Nov 2011 06:22:22 +1100 (EST) Received: from localhost ([::1]:32899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLJuP-0002mX-8f for incoming@patchwork.ozlabs.org; Tue, 01 Nov 2011 15:22:05 -0400 Received: from eggs.gnu.org ([140.186.70.92]:35029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLJuI-0002mE-IS for qemu-devel@nongnu.org; Tue, 01 Nov 2011 15:21:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RLJuH-00087B-KW for qemu-devel@nongnu.org; Tue, 01 Nov 2011 15:21:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65505) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLJuH-00086q-Cp for qemu-devel@nongnu.org; Tue, 01 Nov 2011 15:21:57 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pA1JLs8Q018268 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 1 Nov 2011 15:21:54 -0400 Received: from blackpad.lan.raisama.net (ovpn-113-81.phx2.redhat.com [10.3.113.81]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pA1JLssA012118; Tue, 1 Nov 2011 15:21:54 -0400 Received: by blackpad.lan.raisama.net (Postfix, from userid 500) id 30AC820CED3; Tue, 1 Nov 2011 17:20:30 -0200 (BRST) From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Tue, 1 Nov 2011 17:20:23 -0200 Message-Id: <1320175230-27980-5-git-send-email-ehabkost@redhat.com> In-Reply-To: <1320175230-27980-1-git-send-email-ehabkost@redhat.com> References: <1320175230-27980-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Cc: Michael Roth , Juan Quintela Subject: [Qemu-devel] [RFC PATCH 04/11] migrate_fd_cleanup: accept any negative qemu_fclose() value as error 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 Also, we now return the qemu_fclose() value unchanged to the caller. For reference, the migrate_fd_cleanup() callers are the following: - migrate_fd_completed(): any negative value is considered an error, so the change is OK. - migrate_fd_error(): doesn't check the migrate_fd_cleanup() return value - migrate_fd_cancel(): doesn't check the migrate_fd_cleanup() return value Signed-off-by: Eduardo Habkost --- migration.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/migration.c b/migration.c index 3b4abbd..a98897c 100644 --- a/migration.c +++ b/migration.c @@ -172,9 +172,7 @@ static int migrate_fd_cleanup(MigrationState *s) if (s->file) { DPRINTF("closing file\n"); - if (qemu_fclose(s->file) != 0) { - ret = -1; - } + ret = qemu_fclose(s->file); s->file = NULL; } else { if (s->mon) {