From patchwork Tue Sep 25 13:53:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 186821 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 1E4892C0090 for ; Tue, 25 Sep 2012 23:54:12 +1000 (EST) Received: from localhost ([::1]:46728 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGVaU-0003U8-Bb for incoming@patchwork.ozlabs.org; Tue, 25 Sep 2012 09:54:10 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57934) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGVaG-0003KT-DD for qemu-devel@nongnu.org; Tue, 25 Sep 2012 09:54:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGVa6-0006Kf-T8 for qemu-devel@nongnu.org; Tue, 25 Sep 2012 09:53:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51959) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGVa6-0006KU-Lb; Tue, 25 Sep 2012 09:53:46 -0400 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 q8PDrhnT024185 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 25 Sep 2012 09:53:43 -0400 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q8PDrfCK003775; Tue, 25 Sep 2012 09:53:41 -0400 From: Kevin Wolf To: qemu-devel@nongnu.org Date: Tue, 25 Sep 2012 15:53:39 +0200 Message-Id: <1348581219-8561-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 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, pl@dlhnet.de, qemu-stable@nongnu.org Subject: [Qemu-devel] [PATCH] block-migration: Flush requests in blk_mig_cleanup 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 When cancelling block migration, all in-flight requests of the block migration must be completed before the data can be freed. This was visible as failing assertions and segfaults. Reported-by: Peter Lieven Signed-off-by: Kevin Wolf --- block-migration.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/block-migration.c b/block-migration.c index 7def8ab..ed93301 100644 --- a/block-migration.c +++ b/block-migration.c @@ -519,6 +519,8 @@ static void blk_mig_cleanup(void) BlkMigDevState *bmds; BlkMigBlock *blk; + bdrv_drain_all(); + set_dirty_tracking(0); while ((bmds = QSIMPLEQ_FIRST(&block_mig_state.bmds_list)) != NULL) {