From nobody Mon May 6 01:23:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.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=1565004970; cv=none; d=zoho.com; s=zohoarc; b=HV8a/5orltJGaITp21YhJTMmj+r0LMDWJjkLmIDUudw1blWqsPYy7DVIS2AVEQQLuPKBsJ8G0vuLX67sFnTMcAjGAq3u/1JEQ3hm3LdKZxwN1brrGu8JteJkPyGhB1usaa39PELi9tGVtse6hoDUw//+ebRn9g5UYkL94oftGlg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565004970; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=d+8ZGXS9vYvsibsFRmGLtzKcZF3ZL/txpiODHsGeiys=; b=glc28YsxpO+oqlVwSVZt5oef8Oi1BH1rKJbfcmRuAUzO9SFl9+rVgeBRezxuB6xoxY3nD+HLxai9lO4Lhep/WA9W0f4gA9S2SB/GwRXm+2MDIssbZWWy1/IetIDxocmButkDIbooiR23k+EIVlwlYtNjNfN8fs5zn+NceXaUNkU= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 1565004970173274.55266291334715; Mon, 5 Aug 2019 04:36:10 -0700 (PDT) Received: from localhost ([::1]:52798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hubHd-0001Dz-79 for importer@patchew.org; Mon, 05 Aug 2019 07:36:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60130) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hubH5-0000g1-SR for qemu-devel@nongnu.org; Mon, 05 Aug 2019 07:35:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hubH4-0006UT-W3 for qemu-devel@nongnu.org; Mon, 05 Aug 2019 07:35:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57182) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hubH2-0006Sv-Qj; Mon, 05 Aug 2019 07:35:32 -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 mx1.redhat.com (Postfix) with ESMTPS id E40E52F30C2; Mon, 5 Aug 2019 11:35:31 +0000 (UTC) Received: from localhost (unknown [10.40.205.217]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A7CFF194BE; Mon, 5 Aug 2019 11:35:28 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 5 Aug 2019 13:35:26 +0200 Message-Id: <20190805113526.20319-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 05 Aug 2019 11:35:31 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] iotests: Test unaligned blocking mirror write 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 , Vladimir Sementsov-Ogievskiy , John Snow , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Signed-off-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy --- Hi, this is a test for the mirror bug Vladimir found. Naturally, it depends on some patch to fix it. Based-on: <20190802185830.74648-1-vsementsov@virtuozzo.com> --- tests/qemu-iotests/151 | 25 +++++++++++++++++++++++++ tests/qemu-iotests/151.out | 4 ++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/151 b/tests/qemu-iotests/151 index 1bb74d67c4..ad7359fc8d 100755 --- a/tests/qemu-iotests/151 +++ b/tests/qemu-iotests/151 @@ -114,6 +114,31 @@ class TestActiveMirror(iotests.QMPTestCase): def testActiveIOFlushed(self): self.doActiveIO(True) =20 + def testUnalignedActiveIO(self): + # Fill the source image + result =3D self.vm.hmp_qemu_io('source', 'write -P 1 0 2M') + + # Start the block job (very slowly) + result =3D self.vm.qmp('blockdev-mirror', + job_id=3D'mirror', + filter_node_name=3D'mirror-node', + device=3D'source-node', + target=3D'target-node', + sync=3D'full', + copy_mode=3D'write-blocking', + buf_size=3D(1048576 // 4), + speed=3D1) + self.assert_qmp(result, 'return', {}) + + # Start an unaligned request to a dirty area + result =3D self.vm.hmp_qemu_io('source', 'write -P 2 %i 1' % (1048= 576 + 42)) + + # Let the job finish + result =3D self.vm.qmp('block-job-set-speed', device=3D'mirror', s= peed=3D0) + self.assert_qmp(result, 'return', {}) + self.complete_and_wait(drive=3D'mirror') + + self.potential_writes_in_flight =3D False =20 =20 if __name__ =3D=3D '__main__': diff --git a/tests/qemu-iotests/151.out b/tests/qemu-iotests/151.out index fbc63e62f8..8d7e996700 100644 --- a/tests/qemu-iotests/151.out +++ b/tests/qemu-iotests/151.out @@ -1,5 +1,5 @@ -.. +... ---------------------------------------------------------------------- -Ran 2 tests +Ran 3 tests =20 OK --=20 2.21.0