From nobody Tue Apr 7 23:43:59 2026 Delivered-To: importer@patchew.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773241078698457.6586680130092; Wed, 11 Mar 2026 07:57:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w0L0I-0001R2-4V; Wed, 11 Mar 2026 10:57:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w0L0D-0001Nr-Vh; Wed, 11 Mar 2026 10:57:37 -0400 Received: from proxmox-new.maurer-it.com ([94.136.29.106]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w0L0A-0002oP-UY; Wed, 11 Mar 2026 10:57:37 -0400 Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 0610C874F4; Wed, 11 Mar 2026 15:57:26 +0100 (CET) From: Fiona Ebner To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, hreitz@redhat.com, kwolf@redhat.com, vsementsov@yandex-team.ru, jsnow@redhat.com, qemu-stable@nongnu.org Subject: [PATCH 3/3] iotests/041: add test for duplicate job-complete with throttled target Date: Wed, 11 Mar 2026 15:54:27 +0100 Message-ID: <20260311145717.668492-4-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260311145717.668492-1-f.ebner@proxmox.com> References: <20260311145717.668492-1-f.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1773241010444 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=94.136.29.106; envelope-from=f.ebner@proxmox.com; helo=proxmox-new.maurer-it.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1773241081160158500 Content-Type: text/plain; charset="utf-8" This would fail without commit "block/mirror: fix assertion failure upon duplicate complete for job using 'replaces'". Signed-off-by: Fiona Ebner --- tests/qemu-iotests/041 | 41 ++++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/041.out | 4 ++-- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041 index a7e1980f13..a09fdd4ad6 100755 --- a/tests/qemu-iotests/041 +++ b/tests/qemu-iotests/041 @@ -1456,6 +1456,8 @@ class TestThrottledNBDTarget(iotests.QMPTestCase): } }) =20 + self.drive_qdev =3D '/machine/peripheral/virtio' + def tearDown(self): os.remove(test_img) os.remove(target_img) @@ -1483,6 +1485,45 @@ class TestThrottledNBDTarget(iotests.QMPTestCase): self.assertTrue(iotests.compare_images(test_img, target_img), 'target image does not match source after mirrorin= g') =20 + def test_duplicate_complete_with_replaces(self): + self.qsd.cmd('qom-set', { + 'path': 'thrgr-target', + 'property': 'limits', + 'value' : {}, + }) + + self.vm.cmd('blockdev-mirror', + job_id=3D'mirror', + device=3D'source', + target=3D'target', + replaces=3D'source', + sync=3D'full') + self.wait_ready(drive=3D'mirror') + + self.qsd.cmd('qom-set', { + 'path': 'thrgr-target', + 'property': 'limits', + 'value' : { + 'bps-total': self.bps_total, + } + }) + + self.vm.hmp_qemu_io(self.drive_qdev, 'aio_write -P 7 0 1M', qdev= =3DTrue) + self.vm.hmp_qemu_io(self.drive_qdev, 'aio_write -P 7 1M 1M', qdev= =3DTrue) + self.vm.hmp_qemu_io(self.drive_qdev, 'aio_write -P 7 2M 1M', qdev= =3DTrue) + + self.vm.cmd('job-complete', id=3D'mirror') + # The fact that the target is externally throttled ensures that th= e job + # won't be finished yet when the second command is issued. + self.vm.cmd('job-complete', id=3D'mirror') + + self.vm.qtest(f'clock_step {4 * 1000 * 1000 * 1000}') + self.wait_until_completed('mirror') + + self.vm.shutdown() + self.qsd.stop() + self.assertTrue(iotests.compare_images(test_img, target_img), + 'target image does not match source after mirrorin= g') =20 if __name__ =3D=3D '__main__': iotests.main(supported_fmts=3D['qcow2', 'qed'], diff --git a/tests/qemu-iotests/041.out b/tests/qemu-iotests/041.out index 5273ce86c3..96a0752f44 100644 --- a/tests/qemu-iotests/041.out +++ b/tests/qemu-iotests/041.out @@ -1,5 +1,5 @@ -..........................................................................= .................................. +..........................................................................= ................................... ---------------------------------------------------------------------- -Ran 108 tests +Ran 109 tests =20 OK --=20 2.47.3