From nobody Fri Apr 3 03:01:56 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 1774437165656807.750624742696; Wed, 25 Mar 2026 04:12:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w5M9j-0002Rr-8n; Wed, 25 Mar 2026 07:12:11 -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 1w5M9R-0002Mf-AV; Wed, 25 Mar 2026 07:11:54 -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 1w5M9O-0003OY-SL; Wed, 25 Mar 2026 07:11:52 -0400 Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 5081249081; Wed, 25 Mar 2026 12:11:48 +0100 (CET) From: Fiona Ebner To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, hreitz@redhat.com, kwolf@redhat.com Subject: [PATCH v3 2/2] iotests/041: add test for duplicate job-complete with throttled target Date: Wed, 25 Mar 2026 12:11:04 +0100 Message-ID: <20260325111140.347421-3-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260325111140.347421-1-f.ebner@proxmox.com> References: <20260325111140.347421-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: 1774437060166 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: 1774437168565158500 Content-Type: text/plain; charset="utf-8" This would fail without commit 9ac85f4cc7 ("block/mirror: fix assertion failure upon duplicate complete for job using 'replaces'"). Signed-off-by: Fiona Ebner Reviewed-by: Hanna Czenczek --- No changes in v3. tests/qemu-iotests/041 | 31 +++++++++++++++++++++++++++++++ tests/qemu-iotests/041.out | 4 ++-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041 index 976a12a6f2..17b415aebf 100755 --- a/tests/qemu-iotests/041 +++ b/tests/qemu-iotests/041 @@ -1520,6 +1520,37 @@ 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.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.set_throttle_limits({'iops-write': 1}) + + # Issue requests that will be throttled. + for i in range(0, self.reqs): + req =3D f'aio_write -P 7 {i}M {self.req_len}' + self.vm.hmp_qemu_io(self.drive_qdev, req, 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.disable_throttling() + + self.wait_until_completed('mirror') + + self.target_vm.shutdown() + self.vm.shutdown() + self.assertTrue(iotests.compare_images(test_img, target_img), + 'target image does not match source after mirrorin= g') + if __name__ =3D=3D '__main__': iotests.main(supported_fmts=3D['qcow2', 'qed'], supported_protocols=3D['file'], 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