From patchwork Wed Jun 10 15:55:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 187751 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp609491ilo; Wed, 10 Jun 2020 08:56:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGOiNXsVJP9ISfIz+gqO0+RPo8laUfu5jQkZKtvMCXHl888rQ0sfa1BpXU7WdGAmIYAdzu X-Received: by 2002:ac8:538b:: with SMTP id x11mr3840955qtp.84.1591804582713; Wed, 10 Jun 2020 08:56:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591804582; cv=none; d=google.com; s=arc-20160816; b=ood11+RhH3hP43TCCME9eRx80VZDsqLumYmhvmLC/Sgz8cunp61gofodlnSfSjE9WZ p2ITIfmR2Gyp5wbC4Cn05RArLUIzkX83L1zQ3e4o5a4fL6zQAXfaNTMR0XHeyrnBHXyL hsLwdH6hKu43J0U53v0hYcfq/a16ZsiKqTdEEjg9UhhEMxyK84oJwazPCGVF/cIRrRGX pVxMPhRGA2gmfevSI6OdSyviubza1fl0T+gs0eYtuCTnA/rKr6+YkSge25cK9t1T2lXq v3/QQetFWVBv0X5274KGH8oHEFjeVU2/N17NNxGQVJ1jFei9jqyYbAFpundhA/icmkrm Jk6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=tLxHap7xM5B8vl55s/tokESX8SHGpSJI34kzmwiZhNU=; b=ayzGB9GaP3mW/skPybxgeOZmAcRwLKbEMG2Xty2xY0jyuwomyJ6ZhE1kVsL4wvbTNP vW4TQs3J3wkQBx8A7oRk5ftYUbxGUbvQHNDWq4dFd3Ttjxw0Ao76dC4e+y3Y9IAHRBI7 ZPzDnwbQppwg4tNHqHgxpCakOXd6dGu7yVYBI6vTXqV028w6GIgDXJpV0rrLGQf+dYd5 wWYZTHIf+ewCIfSst3T/2RdHipBJWSfhU9P7Rna3jK0PIWgZYNC+PKhCLx2urg5m95CK A7x5pPTnZ7auGNGeNYBkyPsXDg4UjJKHWe4lu5eb+zdlV7xVLgXdc6qRBbHu1rFc3Dlk YKxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=sfmFmpRI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n67si89055qke.316.2020.06.10.08.56.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jun 2020 08:56:22 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=sfmFmpRI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jj35P-0003h1-S8 for patch@linaro.org; Wed, 10 Jun 2020 11:56:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jj34X-0003dN-PN for qemu-devel@nongnu.org; Wed, 10 Jun 2020 11:55:25 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:37556) by eggs.gnu.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jj34W-0005AM-MY for qemu-devel@nongnu.org; Wed, 10 Jun 2020 11:55:25 -0400 Received: by mail-wm1-x332.google.com with SMTP id y20so2304512wmi.2 for ; Wed, 10 Jun 2020 08:55:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tLxHap7xM5B8vl55s/tokESX8SHGpSJI34kzmwiZhNU=; b=sfmFmpRIZczBnvka/HtSZIF3jUzpWQxrunexyGqlPT/x0A18W/WP0oQkrUN4Ssrj4e 67xM/VgP5YByPwzRk2tuxWzRT9+FLaQWeQazsWlENKvJerMlNYpsNh6NB97tCnQVEGZO ScOkgrXZ+hJZosdQEyRHdytgwpzvQ4HHV5lutxpMC7HUPp4SqeNOdWsXsgLoCS4Xiq95 BJN17wvgduR7UkW44+iPhz5HFkM6LUMwHGiJWoC0jxn+6s+NBzBom0cnVKVstZyqdnXQ oQX5yryhzdbI77t0RkaLJGY7SE27vydyDQaBTfd4a6UM55fbTwM8hTW9uoGPAlV6drVO 9NYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tLxHap7xM5B8vl55s/tokESX8SHGpSJI34kzmwiZhNU=; b=J8n4M9YDdlldFfudyIyIDUl1K//Lz+wVAzx473Xp7U4SNmogSelWNKCOu5djhdYb/s svhp7qxE1wB55jQSdcUPTI3ZPy9MkXec6wxhir/a9Z4NNgnJ0z+k72AaPfOwHnFBM6T9 vSc/rSdrMTydofve8YDB+1NwJ/d7mwnoCstJASTZTupvpYXAB6NobtoKpALwpkNxflov WH9UhlLcJL9iYmPmCS0pVgcxST0XTz+80uf3D69w+MQWs1MVL5jIuRM0rOG2F50g1Vb0 4P1Qoylmx9gLghMmjjVP7koLCf2siKCxb6EwcaVz3ca2k8Vz77hyPlxqQYzbYSgzoK3o xBxQ== X-Gm-Message-State: AOAM530re3G35mTLNfCSoLa4VrGwEnbnwGtHJ6/Zv2qdwJIOxqb5O4Dl bvN6j4YERO5wXeR1P6Ice6GxKA== X-Received: by 2002:a05:600c:22c9:: with SMTP id 9mr4143789wmg.68.1591804515275; Wed, 10 Jun 2020 08:55:15 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id f9sm342176wrf.74.2020.06.10.08.55.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2020 08:55:11 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 03F691FF87; Wed, 10 Jun 2020 16:55:10 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v2 1/6] iotests: 194: wait migration completion on target too Date: Wed, 10 Jun 2020 16:55:04 +0100 Message-Id: <20200610155509.12850-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200610155509.12850-1-alex.bennee@linaro.org> References: <20200610155509.12850-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x332.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Vladimir Sementsov-Ogievskiy , robert.foley@linaro.org, "open list:Block layer core" , =?utf-8?q?Alex_Benn=C3=A9e?= , robhenry@microsoft.com, Max Reitz , aaron@os.amperecomputing.com, cota@braap.org, kuhn.chenqun@huawei.com, peter.puhov@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Vladimir Sementsov-Ogievskiy It is possible, that shutdown on target occurs earlier than migration finish. In this case we crash in bdrv_release_dirty_bitmap_locked() on assertion "assert(!bdrv_dirty_bitmap_busy(bitmap));" as we do have busy bitmap, as bitmap migration is ongoing. We'll fix bitmap migration to gracefully cancel on early shutdown soon. Now let's fix iotest 194 to wait migration completion before shutdown. Note that in this test dest_vm.shutdown() is called implicitly, as vms used as context-providers, see __exit__() method of QEMUMachine class. Actually, not waiting migration finish is a wrong thing, but the test started to crash after commit ae00aa239847682 "iotests: 194: test also migration of dirty bitmap", which added dirty bitmaps here. So, Fixes: tag won't hurt. Fixes: ae00aa2398476824f0eca80461da215e7cdc1c3b Reported-by: Thomas Huth Signed-off-by: Vladimir Sementsov-Ogievskiy Tested-by: Thomas Huth Reviewed-by: Eric Blake Signed-off-by: Alex Bennée Message-Id: <20200604083341.26978-1-vsementsov@virtuozzo.com> --- tests/qemu-iotests/194 | 10 ++++++++++ tests/qemu-iotests/194.out | 5 +++++ 2 files changed, 15 insertions(+) -- 2.20.1 diff --git a/tests/qemu-iotests/194 b/tests/qemu-iotests/194 index 3fad7c6c1ab..6dc2bc94d7e 100755 --- a/tests/qemu-iotests/194 +++ b/tests/qemu-iotests/194 @@ -87,4 +87,14 @@ with iotests.FilePath('source.img') as source_img_path, \ iotests.log(dest_vm.qmp('nbd-server-stop')) break + iotests.log('Wait migration completion on target...') + migr_events = (('MIGRATION', {'data': {'status': 'completed'}}), + ('MIGRATION', {'data': {'status': 'failed'}})) + event = dest_vm.events_wait(migr_events) + iotests.log(event, filters=[iotests.filter_qmp_event]) + + iotests.log('Check bitmaps on source:') iotests.log(source_vm.qmp('query-block')['return'][0]['dirty-bitmaps']) + + iotests.log('Check bitmaps on target:') + iotests.log(dest_vm.qmp('query-block')['return'][0]['dirty-bitmaps']) diff --git a/tests/qemu-iotests/194.out b/tests/qemu-iotests/194.out index dd60dcc14f1..f70cf7610e0 100644 --- a/tests/qemu-iotests/194.out +++ b/tests/qemu-iotests/194.out @@ -21,4 +21,9 @@ Gracefully ending the `drive-mirror` job on source... {"data": {"device": "mirror-job0", "len": 1073741824, "offset": 1073741824, "speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} Stopping the NBD server on destination... {"return": {}} +Wait migration completion on target... +{"data": {"status": "completed"}, "event": "MIGRATION", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +Check bitmaps on source: +[{"busy": false, "count": 0, "granularity": 65536, "name": "bitmap0", "persistent": false, "recording": true, "status": "active"}] +Check bitmaps on target: [{"busy": false, "count": 0, "granularity": 65536, "name": "bitmap0", "persistent": false, "recording": true, "status": "active"}]