From nobody Sun Feb 8 21:28:45 2026 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; 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=virtuozzo.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1581952179773782.9379976824989; Mon, 17 Feb 2020 07:09:39 -0800 (PST) Received: from localhost ([::1]:46850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3i1i-0007xh-E9 for importer@patchew.org; Mon, 17 Feb 2020 10:09:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38975) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3hvM-00044I-Vw for qemu-devel@nongnu.org; Mon, 17 Feb 2020 10:03:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j3hvK-0007O2-B9 for qemu-devel@nongnu.org; Mon, 17 Feb 2020 10:03:04 -0500 Received: from relay.sw.ru ([185.231.240.75]:47426) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j3hvK-0007LC-1o; Mon, 17 Feb 2020 10:03:02 -0500 Received: from vovaso.qa.sw.ru ([10.94.3.0] helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1j3hvG-0007Zt-Lw; Mon, 17 Feb 2020 18:02:58 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v2 16/22] qemu-iotests/199: change discard patterns Date: Mon, 17 Feb 2020 18:02:40 +0300 Message-Id: <20200217150246.29180-17-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200217150246.29180-1-vsementsov@virtuozzo.com> References: <20200217150246.29180-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 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 , vsementsov@virtuozzo.com, qemu-block@nongnu.org, quintela@redhat.com, dgilbert@redhat.com, Max Reitz , andrey.shinkevich@virtuozzo.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" iotest 40 works too long because of many discard opertion. On the same time, postcopy period is very short, in spite of all these efforts. So, let's use less discards (and with more interesting patterns) to reduce test timing. In the next commit we'll increase postcopy period. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Andrey Shinkevich --- tests/qemu-iotests/199 | 44 +++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199 index d78f81b71c..7914fd0b2b 100755 --- a/tests/qemu-iotests/199 +++ b/tests/qemu-iotests/199 @@ -30,6 +30,28 @@ size =3D '256G' fifo =3D os.path.join(iotests.test_dir, 'mig_fifo') =20 =20 +GiB =3D 1024 * 1024 * 1024 + +discards1 =3D ( + (0, GiB), + (2 * GiB + 512 * 5, 512), + (3 * GiB + 512 * 5, 512), + (100 * GiB, GiB) +) + +discards2 =3D ( + (3 * GiB + 512 * 8, 512), + (4 * GiB + 512 * 8, 512), + (50 * GiB, GiB), + (100 * GiB + GiB // 2, GiB) +) + + +def apply_discards(vm, discards): + for d in discards: + vm.hmp_qemu_io('drive0', 'discard {} {}'.format(*d)) + + def event_seconds(event): return event['timestamp']['seconds'] + \ event['timestamp']['microseconds'] / 1000000.0 @@ -80,9 +102,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCa= se): self.vm_b_events =3D [] =20 def test_postcopy(self): - discard_size =3D 0x40000000 granularity =3D 512 - chunk =3D 4096 =20 result =3D self.vm_a.qmp('block-dirty-bitmap-add', node=3D'drive0', name=3D'bitmap', granularity=3Dgranularity) @@ -92,14 +112,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestC= ase): node=3D'drive0', name=3D'bitmap') empty_sha256 =3D result['return']['sha256'] =20 - s =3D 0 - while s < discard_size: - self.vm_a.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk)) - s +=3D 0x10000 - s =3D 0x8000 - while s < discard_size: - self.vm_a.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk)) - s +=3D 0x10000 + apply_discards(self.vm_a, discards1 + discards2) =20 result =3D self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256', node=3D'drive0', name=3D'bitmap') @@ -111,10 +124,8 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTest= Case): result =3D self.vm_a.qmp('block-dirty-bitmap-clear', node=3D'drive= 0', name=3D'bitmap') self.assert_qmp(result, 'return', {}) - s =3D 0 - while s < discard_size: - self.vm_a.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk)) - s +=3D 0x10000 + + apply_discards(self.vm_a, discards1) =20 caps =3D [{'capability': 'dirty-bitmaps', 'state': True}, {'capability': 'events', 'state': True}] @@ -134,10 +145,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTest= Case): e_resume =3D self.vm_b.event_wait('RESUME') self.vm_b_events.append(e_resume) =20 - s =3D 0x8000 - while s < discard_size: - self.vm_b.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk)) - s +=3D 0x10000 + apply_discards(self.vm_b, discards2) =20 match =3D {'data': {'status': 'completed'}} e_complete =3D self.vm_b.event_wait('MIGRATION', match=3Dmatch) --=20 2.21.0