From patchwork Tue Sep 18 10:31:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 1471811 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id DD5D03FCFC for ; Tue, 18 Sep 2012 10:31:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757937Ab2IRKbk (ORCPT ); Tue, 18 Sep 2012 06:31:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65242 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757887Ab2IRKbi (ORCPT ); Tue, 18 Sep 2012 06:31:38 -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 q8IAVZsQ007399 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 18 Sep 2012 06:31:35 -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 q8IAVXIU007667 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 18 Sep 2012 06:31:34 -0400 Message-ID: <50584D84.2080802@redhat.com> Date: Tue, 18 Sep 2012 12:31:32 +0200 From: Kevin Wolf User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 MIME-Version: 1.0 To: Peter Lieven CC: "qemu-devel@nongnu.org" , "kvm@vger.kernel.org" , Paolo Bonzini Subject: Re: [Qemu-devel] Block Migration Assertion in qemu-kvm 1.2.0 References: <5055A643.8060505@dlhnet.de> <5056E221.8020106@redhat.com> <5057842F.6090506@dlhnet.de> <50584CC6.2030207@dlhnet.de> In-Reply-To: <50584CC6.2030207@dlhnet.de> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Am 18.09.2012 12:28, schrieb Peter Lieven: > On 09/17/12 22:12, Peter Lieven wrote: >> On 09/17/12 10:41, Kevin Wolf wrote: >>> Am 16.09.2012 12:13, schrieb Peter Lieven: >>>> Hi, >>>> >>>> when trying to block migrate a VM from one node to another, the source >>>> VM crashed with the following assertion: >>>> block.c:3829: bdrv_set_in_use: Assertion `bs->in_use != in_use' failed. >>>> >>>> Is this sth already addresses/known? >>> Not that I'm aware of, at least. >>> >>> Block migration doesn't seem to check whether the device is already in >>> use, maybe this is the problem. Not sure why it would be in use, though, >>> and in my quick test it didn't crash. >>> >>> So we need some more information: What's you command line, did you do >>> anything specific in the monitor with block devices, what does the >>> stacktrace look like, etc.? >> kevin, it seems that i can very easily force a crash if I cancel a >> running block migration. > if I understand correctly what happens there are aio callbacks coming in > after > blk_mig_cleanup() has been called. > > what is the proper way to detect this in blk_mig_read_cb()? You could try this, it doesn't detect the situation in blk_mig_read_cb(), but ensures that all callbacks happen before we do the actual cleanup (completely untested): --- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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) {