From nobody Mon Feb 9 15:11:22 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1595883595; cv=none; d=zohomail.com; s=zohoarc; b=aarNrEbsziE8fBG/qQ5OLcuIurFPQDKczz7h9DLbt4Z9G1U53U/XxkQNf5AnylGjIkX2WHBGyvE+9jKzRr9M+B1G4J3dCbrKa6P34OlgZISN1DE3EGiDIMKhtXFQ7ROO48NQ+T/2dj9x5Bgf94hrWfEHwYctDIKIgj86CMUR944= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595883595; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cA9n+9vu4RgRBMfOB0BWmNw9KgmpftfRQAnntZebbp8=; b=MPK9OTPGp6XWjb8nmS8uJ/xre3my/ZdL9WkG/AM8FyEDxkeBQKzsZs+wmXLbfOIG/Yy0WOHva8/YSr84Q0sCGfNaFewEP95AOohM3LGy39VNz5++ACXsM9/OsM0S6V1kWi/EsnF1Lbj9bV6ej4rnF98X3WT1WTciQ6EIEEd0Jp0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1595883595538735.1575523901103; Mon, 27 Jul 2020 13:59:55 -0700 (PDT) Received: from localhost ([::1]:52864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k0ADy-0002L9-6q for importer@patchew.org; Mon, 27 Jul 2020 16:59:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34898) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k0AAK-0005DT-3x for qemu-devel@nongnu.org; Mon, 27 Jul 2020 16:56:08 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:34776 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1k0AAI-0004uq-1q for qemu-devel@nongnu.org; Mon, 27 Jul 2020 16:56:07 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-461-sT8M28lkPWyJpMFtz0h3Qg-1; Mon, 27 Jul 2020 16:56:01 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F2934101C8A0; Mon, 27 Jul 2020 20:55:59 +0000 (UTC) Received: from blue.redhat.com (ovpn-118-248.rdu2.redhat.com [10.10.118.248]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1D6ED19945; Mon, 27 Jul 2020 20:55:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595883365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cA9n+9vu4RgRBMfOB0BWmNw9KgmpftfRQAnntZebbp8=; b=O3bChZA04s3hqNhXKcpzDWE/VhCXfBUP5fQYs2bVAJeP863pychiY+lMLRdQWGNt4uK7Sp ugHFW+/fm1SV6W1fjtFbk4cGN77fjKmQYHVlqoheeJByVza063XRawpXXSU2DzTNWSkKRL r0b6N3FEMjHG31Ex0TbdtDh6Zv1Ryc8= X-MC-Unique: sT8M28lkPWyJpMFtz0h3Qg-1 From: Eric Blake To: qemu-devel@nongnu.org Subject: [PULL 07/24] qemu-iotests/199: increase postcopy period Date: Mon, 27 Jul 2020 15:55:26 -0500 Message-Id: <20200727205543.206624-8-eblake@redhat.com> In-Reply-To: <20200727205543.206624-1-eblake@redhat.com> References: <20200727205543.206624-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.81; envelope-from=eblake@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/27 03:37:14 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no 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 , Andrey Shinkevich , Vladimir Sementsov-Ogievskiy , "open list:Block layer core" , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy The test wants to force a bitmap postcopy. Still, the resulting postcopy period is very small. Let's increase it by adding more bitmaps to migrate. Also, test disabled bitmaps migration. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Andrey Shinkevich Tested-by: Eric Blake Message-Id: <20200727194236.19551-7-vsementsov@virtuozzo.com> Signed-off-by: Eric Blake --- tests/qemu-iotests/199 | 66 +++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 23 deletions(-) diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199 index da4dae01fb5d..d8532e49da00 100755 --- a/tests/qemu-iotests/199 +++ b/tests/qemu-iotests/199 @@ -103,30 +103,46 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTes= tCase): def test_postcopy(self): granularity =3D 512 + nb_bitmaps =3D 15 - result =3D self.vm_a.qmp('block-dirty-bitmap-add', node=3D'drive0', - name=3D'bitmap', granularity=3Dgranularity) - self.assert_qmp(result, 'return', {}) + for i in range(nb_bitmaps): + result =3D self.vm_a.qmp('block-dirty-bitmap-add', node=3D'dri= ve0', + name=3D'bitmap{}'.format(i), + granularity=3Dgranularity) + self.assert_qmp(result, 'return', {}) result =3D self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256', - node=3D'drive0', name=3D'bitmap') + node=3D'drive0', name=3D'bitmap0') empty_sha256 =3D result['return']['sha256'] - apply_discards(self.vm_a, discards1 + discards2) - - result =3D self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256', - node=3D'drive0', name=3D'bitmap') - sha256 =3D result['return']['sha256'] - - # Check, that updating the bitmap by discards works - assert sha256 !=3D empty_sha256 - - result =3D self.vm_a.qmp('block-dirty-bitmap-clear', node=3D'drive= 0', - name=3D'bitmap') - self.assert_qmp(result, 'return', {}) - apply_discards(self.vm_a, discards1) + result =3D self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256', + node=3D'drive0', name=3D'bitmap0') + discards1_sha256 =3D result['return']['sha256'] + + # Check, that updating the bitmap by discards works + assert discards1_sha256 !=3D empty_sha256 + + # We want to calculate resulting sha256. Do it in bitmap0, so, dis= able + # other bitmaps + for i in range(1, nb_bitmaps): + result =3D self.vm_a.qmp('block-dirty-bitmap-disable', node=3D= 'drive0', + name=3D'bitmap{}'.format(i)) + self.assert_qmp(result, 'return', {}) + + apply_discards(self.vm_a, discards2) + + result =3D self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256', + node=3D'drive0', name=3D'bitmap0') + all_discards_sha256 =3D result['return']['sha256'] + + # Now, enable some bitmaps, to be updated during migration + for i in range(2, nb_bitmaps, 2): + result =3D self.vm_a.qmp('block-dirty-bitmap-enable', node=3D'= drive0', + name=3D'bitmap{}'.format(i)) + self.assert_qmp(result, 'return', {}) + caps =3D [{'capability': 'dirty-bitmaps', 'state': True}, {'capability': 'events', 'state': True}] @@ -145,6 +161,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestC= ase): event_resume =3D self.vm_b.event_wait('RESUME') self.vm_b_events.append(event_resume) + # enabled bitmaps should be updated apply_discards(self.vm_b, discards2) match =3D {'data': {'status': 'completed'}} @@ -158,7 +175,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestC= ase): downtime =3D event_dist(event_stop, event_resume) postcopy_time =3D event_dist(event_resume, event_complete) - # TODO: assert downtime * 10 < postcopy_time + assert downtime * 10 < postcopy_time if debug: print('downtime:', downtime) print('postcopy_time:', postcopy_time) @@ -166,12 +183,15 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTes= tCase): # Assert that bitmap migration is finished (check that successor b= itmap # is removed) result =3D self.vm_b.qmp('query-block') - assert len(result['return'][0]['dirty-bitmaps']) =3D=3D 1 + assert len(result['return'][0]['dirty-bitmaps']) =3D=3D nb_bitmaps - # Check content of migrated (and updated by new writes) bitmap - result =3D self.vm_b.qmp('x-debug-block-dirty-bitmap-sha256', - node=3D'drive0', name=3D'bitmap') - self.assert_qmp(result, 'return/sha256', sha256) + # Check content of migrated bitmaps. Still, don't waste time check= ing + # every bitmap + for i in range(0, nb_bitmaps, 5): + result =3D self.vm_b.qmp('x-debug-block-dirty-bitmap-sha256', + node=3D'drive0', name=3D'bitmap{}'.form= at(i)) + sha256 =3D discards1_sha256 if i % 2 else all_discards_sha256 + self.assert_qmp(result, 'return/sha256', sha256) if __name__ =3D=3D '__main__': --=20 2.27.0