From patchwork Sun Feb 10 22:12:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 219527 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 542662C02EA for ; Mon, 11 Feb 2013 09:31:01 +1100 (EST) Received: from localhost ([::1]:46807 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4fAD-0004Xt-SL for incoming@patchwork.ozlabs.org; Sun, 10 Feb 2013 17:14:21 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4f9l-0003U5-08 for qemu-devel@nongnu.org; Sun, 10 Feb 2013 17:13:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U4f9f-0001Gi-92 for qemu-devel@nongnu.org; Sun, 10 Feb 2013 17:13:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53709) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4f9f-0001GY-10 for qemu-devel@nongnu.org; Sun, 10 Feb 2013 17:13:47 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r1AMDeO2027297 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 10 Feb 2013 17:13:41 -0500 Received: from localhost (ovpn-112-28.ams2.redhat.com [10.36.112.28]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r1AMDc4L012301; Sun, 10 Feb 2013 17:13:39 -0500 From: Stefan Hajnoczi To: Date: Sun, 10 Feb 2013 23:12:45 +0100 Message-Id: <1360534366-26723-3-git-send-email-stefanha@redhat.com> In-Reply-To: <1360534366-26723-1-git-send-email-stefanha@redhat.com> References: <1360534366-26723-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Anthony Liguori , david.pravec@nethost.cz, Juan Quintela , Michael Roth , Stefan Hajnoczi , Paolo Bonzini Subject: [Qemu-devel] [PATCH for-1.4 stable v2 2/3] block-migration: fix blk_mig_save_dirty_block() return value checking 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 Commit 43be3a25c931a7f61a76fbfc9d35584cbfc5fb58 changed the blk_mig_save_dirty_block() return code handling. The function's doc comment says: /* return value: * 0: too much data for max_downtime * 1: few enough data for max_downtime */ Because of the 1 return value, callers must check for ret < 0 instead of just: if (ret) { ... } We do not want to bail when 1 is returned, only on error. Signed-off-by: Stefan Hajnoczi --- block-migration.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block-migration.c b/block-migration.c index 573319a..a91d96b 100644 --- a/block-migration.c +++ b/block-migration.c @@ -569,7 +569,7 @@ static int block_save_iterate(QEMUFile *f, void *opaque) } } } - if (ret) { + if (ret < 0) { blk_mig_cleanup(); return ret; } @@ -609,7 +609,7 @@ static int block_save_complete(QEMUFile *f, void *opaque) } while (ret == 0); blk_mig_cleanup(); - if (ret) { + if (ret < 0) { return ret; } /* report completion */