From patchwork Sat Feb 9 18:01:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 219415 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 2A6E72C008D for ; Sun, 10 Feb 2013 05:04:48 +1100 (EST) Received: from localhost ([::1]:41477 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4En7-0002Jr-Rp for incoming@patchwork.ozlabs.org; Sat, 09 Feb 2013 13:04:45 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4Emq-00024E-HL for qemu-devel@nongnu.org; Sat, 09 Feb 2013 13:04:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U4Eml-0004XH-N9 for qemu-devel@nongnu.org; Sat, 09 Feb 2013 13:04:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:10153) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4Eml-0004X3-GV for qemu-devel@nongnu.org; Sat, 09 Feb 2013 13:04:23 -0500 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 r19I4HVE014676 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 9 Feb 2013 13:04:17 -0500 Received: from localhost (ovpn-112-24.ams2.redhat.com [10.36.112.24]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r19I4Fjk030932; Sat, 9 Feb 2013 13:04:16 -0500 From: Stefan Hajnoczi To: Date: Sat, 9 Feb 2013 19:01:59 +0100 Message-Id: <1360432919-1379-4-git-send-email-stefanha@redhat.com> In-Reply-To: <1360432919-1379-1-git-send-email-stefanha@redhat.com> References: <1360432919-1379-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 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 3/3] block-migration: fix block_save_iterate() return value 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 The .save_live_iterate() function returns 0 it continue iterating or 1 to stop iterating. Since 16310a3cca7320edb9341c976f7819de0a8c27e0 it only ever returns 0, leading to an infinite loop. Return 1 if we have finished sending dirty blocks. Signed-off-by: Stefan Hajnoczi Reviewed-by: Juan Quintela --- block-migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block-migration.c b/block-migration.c index a91d96b..e9bc200 100644 --- a/block-migration.c +++ b/block-migration.c @@ -582,7 +582,7 @@ static int block_save_iterate(QEMUFile *f, void *opaque) qemu_put_be64(f, BLK_MIG_FLAG_EOS); - return 0; + return get_remaining_dirty() == 0; } static int block_save_complete(QEMUFile *f, void *opaque)