From nobody Sat May 18 10:57:18 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=1561674936; cv=none; d=zoho.com; s=zohoarc; b=S9OyBn96Q/MqVrMDVxfBHpXjEc6w2ZOKx1GowA3EZEImZbRUsEQ5VsjAQ81rc/gJkKch2z10xm8J59OzwqzdV8MDewlMGMl33ffbEjE8bByg4E200B2nrkixHFbxRP+GUJbcU2mPBwuRiZDTbdXpTHL0vK8gY21Vz6wiEjNip7E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561674936; h=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:ARC-Authentication-Results; bh=r3jsiHqycpd1IgtGmvWHRtxZzv+I0SEuMxnye10hTbw=; b=N9tRndGKj92G8KDINRl3S2nDsW7gJ+yDCy/eaxZdF2Xjer5BPqxbWflXJ++J5wvl5rFmar/A9KFxZsvUrFvklXJi2C+3a7QoIHaCGhjBKxqXxwkkiE9r7+1NcSi23WVtejV9EO4r8h849l4nixKDr7UVoiyNKH9DdhIINR9WKD0= 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 1561674936091678.9425811740547; Thu, 27 Jun 2019 15:35:36 -0700 (PDT) Received: from localhost ([::1]:55070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgczC-0002Yb-SF for importer@patchew.org; Thu, 27 Jun 2019 18:35:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44200) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgcxQ-0000KG-JX for qemu-devel@nongnu.org; Thu, 27 Jun 2019 18:33:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgcxN-0004Ea-Ua for qemu-devel@nongnu.org; Thu, 27 Jun 2019 18:33:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39776) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hgcxH-0003xl-Ca; Thu, 27 Jun 2019 18:33:23 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C1C5D65CE2; Thu, 27 Jun 2019 22:33:08 +0000 (UTC) Received: from localhost (ovpn-204-47.brq.redhat.com [10.40.204.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0DBDC608C1; Thu, 27 Jun 2019 22:33:03 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Fri, 28 Jun 2019 00:32:51 +0200 Message-Id: <20190627223255.3789-2-mreitz@redhat.com> In-Reply-To: <20190627223255.3789-1-mreitz@redhat.com> References: <20190627223255.3789-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 27 Jun 2019 22:33:13 +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 1/5] block: Add BDS.never_freeze 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 , Alberto Garcia , qemu-devel@nongnu.org, Max Reitz , Andrey Shinkevich , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The commit and the mirror block job must be able to drop their filter node at any point. However, this will not be possible if any of the BdrvChild links to them is frozen. Therefore, we need to prevent them from ever becoming frozen. Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia Reviewed-by: Andrey Shinkevich --- include/block/block_int.h | 3 +++ block.c | 8 ++++++++ block/commit.c | 4 ++++ block/mirror.c | 4 ++++ 4 files changed, 19 insertions(+) diff --git a/include/block/block_int.h b/include/block/block_int.h index d6415b53c1..50902531b7 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -885,6 +885,9 @@ struct BlockDriverState { =20 /* Only read/written by whoever has set active_flush_req to true. */ unsigned int flushed_gen; /* Flushed write generation */ + + /* BdrvChild links to this node may never be frozen */ + bool never_freeze; }; =20 struct BlockBackendRootState { diff --git a/block.c b/block.c index c139540f2b..6565192b91 100644 --- a/block.c +++ b/block.c @@ -4416,6 +4416,14 @@ int bdrv_freeze_backing_chain(BlockDriverState *bs, = BlockDriverState *base, return -EPERM; } =20 + for (i =3D bs; i !=3D base; i =3D backing_bs(i)) { + if (i->backing && backing_bs(i)->never_freeze) { + error_setg(errp, "Cannot freeze '%s' link to '%s'", + i->backing->name, backing_bs(i)->node_name); + return -EPERM; + } + } + for (i =3D bs; i !=3D base; i =3D backing_bs(i)) { if (i->backing) { i->backing->frozen =3D true; diff --git a/block/commit.c b/block/commit.c index ca7e408b26..2c5a6d4ebc 100644 --- a/block/commit.c +++ b/block/commit.c @@ -298,6 +298,10 @@ void commit_start(const char *job_id, BlockDriverState= *bs, if (!filter_node_name) { commit_top_bs->implicit =3D true; } + + /* So that we can always drop this node */ + commit_top_bs->never_freeze =3D true; + commit_top_bs->total_sectors =3D top->total_sectors; =20 bdrv_append(commit_top_bs, top, &local_err); diff --git a/block/mirror.c b/block/mirror.c index 2fcec70e35..8cb75fb409 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1551,6 +1551,10 @@ static BlockJob *mirror_start_job( if (!filter_node_name) { mirror_top_bs->implicit =3D true; } + + /* So that we can always drop this node */ + mirror_top_bs->never_freeze =3D true; + mirror_top_bs->total_sectors =3D bs->total_sectors; mirror_top_bs->supported_write_flags =3D BDRV_REQ_WRITE_UNCHANGED; mirror_top_bs->supported_zero_flags =3D BDRV_REQ_WRITE_UNCHANGED | --=20 2.21.0 From nobody Sat May 18 10:57:18 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=1561675133; cv=none; d=zoho.com; s=zohoarc; b=f8/HasvIvV0bAIbQzBhszRGlT+6rQ0SJcNkZnWJ+VMS6x9R0X53pMDCj4LAh4yf7xG8NV6RtHsi7ozBnkuxMOhaZ/z5IwpDQr6EpfYdECZvqLsb5x/7aOj077FkQ+v6uY6XgYt+QS/fhqGmdxW6QsTrOeU0oF5wRCikLpWfXgOM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561675133; h=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:ARC-Authentication-Results; bh=rjJ/RE2dg39oOcWa5CEXmGaMOQcJXPYsXTP7Vtoq81E=; b=JEM/Ls0xy4QeBPRVUToQmoH9iGdO97cFPjfrh/DyOHjYyVhX/ocIrsluH7Gu1/XkS4Q5SoAOC3fIXmvly3mLdwJHAlRESrpyhz4uYQivCEAQQQ+JuAfIUOu7EAnuuRIPCbuzCUdr3vH7/Ppeyz9f2gCzuf3jqK+ZRClsWOSprd0= 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 1561675133340331.48067235987753; Thu, 27 Jun 2019 15:38:53 -0700 (PDT) Received: from localhost ([::1]:55094 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgd2X-0006GL-Ia for importer@patchew.org; Thu, 27 Jun 2019 18:38:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44233) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgcxR-0000Oo-UA for qemu-devel@nongnu.org; Thu, 27 Jun 2019 18:33:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgcxO-0004FO-Kq for qemu-devel@nongnu.org; Thu, 27 Jun 2019 18:33:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47800) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hgcxH-0003xn-Cc; Thu, 27 Jun 2019 18:33:23 -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 84929C18B2C1; Thu, 27 Jun 2019 22:33:15 +0000 (UTC) Received: from localhost (ovpn-204-47.brq.redhat.com [10.40.204.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B623419C4F; Thu, 27 Jun 2019 22:33:10 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Fri, 28 Jun 2019 00:32:52 +0200 Message-Id: <20190627223255.3789-3-mreitz@redhat.com> In-Reply-To: <20190627223255.3789-1-mreitz@redhat.com> References: <20190627223255.3789-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.31]); Thu, 27 Jun 2019 22:33:15 +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 2/5] iotests: Fix throttling in 030 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 , Alberto Garcia , qemu-devel@nongnu.org, Max Reitz , Andrey Shinkevich , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Currently, TestParallelOps in 030 creates images that are too small for job throttling to be effective. This is reflected by the fact that it never undoes the throttling. Increase the image size and undo the throttling when the job should be completed. Also, add throttling in test_overlapping_4, or the jobs may not be so overlapping after all. In fact, the error usually emitted here is that node2 simply does not exist, not that overlapping jobs are not allowed -- the fact that this job ignores the exact error messages and just checks the error class is something that should be fixed in a follow-up patch. Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia Tested-by: Andrey Shinkevich --- tests/qemu-iotests/030 | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index c6311d1825..2cf8d54dc5 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -154,7 +154,7 @@ class TestSingleDrive(iotests.QMPTestCase): class TestParallelOps(iotests.QMPTestCase): num_ops =3D 4 # Number of parallel block-stream operations num_imgs =3D num_ops * 2 + 1 - image_len =3D num_ops * 512 * 1024 + image_len =3D num_ops * 4 * 1024 * 1024 imgs =3D [] =20 def setUp(self): @@ -176,11 +176,11 @@ class TestParallelOps(iotests.QMPTestCase): # Put data into the images we are copying data from odd_img_indexes =3D [x for x in reversed(range(self.num_imgs)) if = x % 2 =3D=3D 1] for i in range(len(odd_img_indexes)): - # Alternate between 256KB and 512KB. + # Alternate between 2MB and 4MB. # This way jobs will not finish in the same order they were cr= eated - num_kb =3D 256 + 256 * (i % 2) + num_mb =3D 2 + 2 * (i % 2) qemu_io('-f', iotests.imgfmt, - '-c', 'write -P 0xFF %dk %dk' % (i * 512, num_kb), + '-c', 'write -P 0xFF %dM %dM' % (i * 4, num_mb), self.imgs[odd_img_indexes[i]]) =20 # Attach the drive to the VM @@ -213,6 +213,10 @@ class TestParallelOps(iotests.QMPTestCase): result =3D self.vm.qmp('block-stream', device=3Dnode_name, job= _id=3Djob_id, base=3Dself.imgs[i-2], speed=3D512*1024) self.assert_qmp(result, 'return', {}) =20 + for job in pending_jobs: + result =3D self.vm.qmp('block-job-set-speed', device=3Djob, sp= eed=3D0) + self.assert_qmp(result, 'return', {}) + # Wait for all jobs to be finished. while len(pending_jobs) > 0: for event in self.vm.get_qmp_events(wait=3DTrue): @@ -260,6 +264,9 @@ class TestParallelOps(iotests.QMPTestCase): result =3D self.vm.qmp('block-commit', device=3D'drive0', base=3Ds= elf.imgs[0], top=3Dself.imgs[1], job_id=3D'commit-node0') self.assert_qmp(result, 'error/class', 'GenericError') =20 + result =3D self.vm.qmp('block-job-set-speed', device=3D'stream-nod= e4', speed=3D0) + self.assert_qmp(result, 'return', {}) + self.wait_until_completed(drive=3D'stream-node4') self.assert_no_active_block_jobs() =20 @@ -289,6 +296,9 @@ class TestParallelOps(iotests.QMPTestCase): result =3D self.vm.qmp('block-stream', device=3D'drive0', base=3Ds= elf.imgs[5], job_id=3D'stream-drive0') self.assert_qmp(result, 'error/class', 'GenericError') =20 + result =3D self.vm.qmp('block-job-set-speed', device=3D'commit-nod= e3', speed=3D0) + self.assert_qmp(result, 'return', {}) + self.wait_until_completed(drive=3D'commit-node3') =20 # Similar to test_overlapping_2, but here block-commit doesn't use the= 'top' parameter. @@ -309,6 +319,9 @@ class TestParallelOps(iotests.QMPTestCase): self.assert_qmp(event, 'data/type', 'commit') self.assert_qmp_absent(event, 'data/error') =20 + result =3D self.vm.qmp('block-job-set-speed', device=3D'commit-dri= ve0', speed=3D0) + self.assert_qmp(result, 'return', {}) + result =3D self.vm.qmp('block-job-complete', device=3D'commit-driv= e0') self.assert_qmp(result, 'return', {}) =20 @@ -321,13 +334,18 @@ class TestParallelOps(iotests.QMPTestCase): self.assert_no_active_block_jobs() =20 # Commit from node2 into node0 - result =3D self.vm.qmp('block-commit', device=3D'drive0', top=3Dse= lf.imgs[2], base=3Dself.imgs[0]) + result =3D self.vm.qmp('block-commit', device=3D'drive0', + top=3Dself.imgs[2], base=3Dself.imgs[0], + speed=3D1024*1024) self.assert_qmp(result, 'return', {}) =20 # Stream from node2 into node4 result =3D self.vm.qmp('block-stream', device=3D'node4', base_node= =3D'node2', job_id=3D'node4') self.assert_qmp(result, 'error/class', 'GenericError') =20 + result =3D self.vm.qmp('block-job-set-speed', device=3D'drive0', s= peed=3D0) + self.assert_qmp(result, 'return', {}) + self.wait_until_completed() self.assert_no_active_block_jobs() =20 @@ -378,6 +396,10 @@ class TestParallelOps(iotests.QMPTestCase): result =3D self.vm.qmp('block-commit', device=3D'drive0', base=3Ds= elf.imgs[5], speed=3D1024*1024) self.assert_qmp(result, 'return', {}) =20 + for job in ['drive0', 'node4']: + result =3D self.vm.qmp('block-job-set-speed', device=3Djob, sp= eed=3D0) + self.assert_qmp(result, 'return', {}) + # Wait for all jobs to be finished. pending_jobs =3D ['node4', 'drive0'] while len(pending_jobs) > 0: --=20 2.21.0 From nobody Sat May 18 10:57:18 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=1561674937; cv=none; d=zoho.com; s=zohoarc; b=m5qZxWKdEEf31kEZwRJwKtrbVX0WzfXjelFA9NxjZz9yrUCHm0K+aNY3YA4doHZy+zmHBK8r4rnoZRJ0E45ZplgqUZs9qtGCk36HPdB0EH+slz9sUJOajCr6jwt4hGVyRmeWjABBmeDk/5Lp4GdZ78tSVJsf3iDUVak8JZuDezM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561674937; h=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:ARC-Authentication-Results; bh=6nq/SQdb4ff9x7z8FzwEDu0Jm/JZ7xl/8+pNSGJeTp4=; b=iBSYLzVZuesbD+BKUoYTanF4cuy7RSAFtCJko1g0DLMBPhAdY3MWukY9xcQ/AVOZo89t/h0JpN8Mhw+RgRpPY3jI5mngDYRVDOK42Oh4SOkZ1TJI3nVZIeaaxYeKawTEY+XaCYwo4fUbYSI70IOWa07iWVea9gSMZa3IYWwPKm0= 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 1561674937624350.739169923584; Thu, 27 Jun 2019 15:35:37 -0700 (PDT) Received: from localhost ([::1]:55072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgczO-0002lB-Qq for importer@patchew.org; Thu, 27 Jun 2019 18:35:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44279) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgcxU-0000Ro-BX for qemu-devel@nongnu.org; Thu, 27 Jun 2019 18:33:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgcxQ-0004HS-5y for qemu-devel@nongnu.org; Thu, 27 Jun 2019 18:33:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49926) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hgcxH-00042k-CL; Thu, 27 Jun 2019 18:33:23 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5A578308A9E2; Thu, 27 Jun 2019 22:33:20 +0000 (UTC) Received: from localhost (ovpn-204-47.brq.redhat.com [10.40.204.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6A4935D9D2; Thu, 27 Jun 2019 22:33:17 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Fri, 28 Jun 2019 00:32:53 +0200 Message-Id: <20190627223255.3789-4-mreitz@redhat.com> In-Reply-To: <20190627223255.3789-1-mreitz@redhat.com> References: <20190627223255.3789-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 27 Jun 2019 22:33:20 +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 3/5] iotests: Compare error messages in 030 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 , Alberto Garcia , qemu-devel@nongnu.org, Max Reitz , Andrey Shinkevich , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Currently, 030 just compares the error class, which does not say anything. Before HEAD^ added throttling to test_overlapping_4, that test actually usually failed because node2 was already gone, not because it was the commit and stream job were not allowed to overlap. Prevent such problems in the future by comparing the error description instead. Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia Tested-by: Andrey Shinkevich --- tests/qemu-iotests/030 | 66 +++++++++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 24 deletions(-) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index 2cf8d54dc5..10fe1de89d 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -144,11 +144,12 @@ class TestSingleDrive(iotests.QMPTestCase): =20 def test_device_not_found(self): result =3D self.vm.qmp('block-stream', device=3D'nonexistent') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + 'Cannot find device=3Dnonexistent nor node_name=3Dnonexistent') =20 def test_job_id_missing(self): result =3D self.vm.qmp('block-stream', device=3D'mid') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', "Invalid job ID ''") =20 =20 class TestParallelOps(iotests.QMPTestCase): @@ -245,24 +246,30 @@ class TestParallelOps(iotests.QMPTestCase): self.assert_qmp(result, 'return', {}) =20 result =3D self.vm.qmp('block-stream', device=3D'node5', job_id=3D= 'stream-node5', base=3Dself.imgs[2]) - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node4' is busy: block device is in use by block job: st= ream") =20 result =3D self.vm.qmp('block-stream', device=3D'node3', job_id=3D= 'stream-node3', base=3Dself.imgs[2]) - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node3' is busy: block device is in use by block job: st= ream") =20 result =3D self.vm.qmp('block-stream', device=3D'node4', job_id=3D= 'stream-node4-v2') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node4' is busy: block device is in use by block job: st= ream") =20 # block-commit should also fail if it touches nodes used by the st= ream job result =3D self.vm.qmp('block-commit', device=3D'drive0', base=3Ds= elf.imgs[4], job_id=3D'commit-node4') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node4' is busy: block device is in use by block job: st= ream") =20 result =3D self.vm.qmp('block-commit', device=3D'drive0', base=3Ds= elf.imgs[1], top=3Dself.imgs[3], job_id=3D'commit-node1') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node3' is busy: block device is in use by block job: st= ream") =20 # This fails because it needs to modify the backing string in node= 2, which is blocked result =3D self.vm.qmp('block-commit', device=3D'drive0', base=3Ds= elf.imgs[0], top=3Dself.imgs[1], job_id=3D'commit-node0') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node2' is busy: block device is in use by block job: st= ream") =20 result =3D self.vm.qmp('block-job-set-speed', device=3D'stream-nod= e4', speed=3D0) self.assert_qmp(result, 'return', {}) @@ -281,20 +288,25 @@ class TestParallelOps(iotests.QMPTestCase): self.assert_qmp(result, 'return', {}) =20 result =3D self.vm.qmp('block-stream', device=3D'node3', job_id=3D= 'stream-node3') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node3' is busy: block device is in use by block job: co= mmit") =20 result =3D self.vm.qmp('block-stream', device=3D'node6', base=3Dse= lf.imgs[2], job_id=3D'stream-node6') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node5' is busy: block device is in use by block job: co= mmit") =20 result =3D self.vm.qmp('block-stream', device=3D'node4', base=3Dse= lf.imgs[2], job_id=3D'stream-node4') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node4' is busy: block device is in use by block job: co= mmit") =20 result =3D self.vm.qmp('block-stream', device=3D'node6', base=3Dse= lf.imgs[4], job_id=3D'stream-node6-v2') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node5' is busy: block device is in use by block job: co= mmit") =20 # This fails because block-commit currently blocks the active laye= r even if it's not used result =3D self.vm.qmp('block-stream', device=3D'drive0', base=3Ds= elf.imgs[5], job_id=3D'stream-drive0') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'drive0' is busy: block device is in use by block job: c= ommit") =20 result =3D self.vm.qmp('block-job-set-speed', device=3D'commit-nod= e3', speed=3D0) self.assert_qmp(result, 'return', {}) @@ -312,7 +324,8 @@ class TestParallelOps(iotests.QMPTestCase): self.assert_qmp(result, 'return', {}) =20 result =3D self.vm.qmp('block-stream', device=3D'node5', base=3Dse= lf.imgs[3], job_id=3D'stream-node6') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node5' is busy: block device is in use by block job: co= mmit") =20 event =3D self.vm.event_wait(name=3D'BLOCK_JOB_READY') self.assert_qmp(event, 'data/device', 'commit-drive0') @@ -328,20 +341,21 @@ class TestParallelOps(iotests.QMPTestCase): self.wait_until_completed(drive=3D'commit-drive0') =20 # In this case the base node of the stream job is the same as the - # top node of commit job. Since block-commit removes the top node - # when it finishes, this is not allowed. + # top node of commit job. Since this results in the commit filter + # node being part of the stream chain, this is not allowed. def test_overlapping_4(self): self.assert_no_active_block_jobs() =20 # Commit from node2 into node0 result =3D self.vm.qmp('block-commit', device=3D'drive0', top=3Dself.imgs[2], base=3Dself.imgs[0], - speed=3D1024*1024) + filter_node_name=3D'commit-filter', speed=3D1= 024*1024) self.assert_qmp(result, 'return', {}) =20 # Stream from node2 into node4 result =3D self.vm.qmp('block-stream', device=3D'node4', base_node= =3D'node2', job_id=3D'node4') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Cannot freeze 'backing' link to 'commit-filter'") =20 result =3D self.vm.qmp('block-job-set-speed', device=3D'drive0', s= peed=3D0) self.assert_qmp(result, 'return', {}) @@ -428,19 +442,23 @@ class TestParallelOps(iotests.QMPTestCase): =20 # Error: the base node does not exist result =3D self.vm.qmp('block-stream', device=3D'node4', base_node= =3D'none', job_id=3D'stream') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + 'Cannot find device=3D nor node_name=3Dnone') =20 # Error: the base node is not a backing file of the top node result =3D self.vm.qmp('block-stream', device=3D'node4', base_node= =3D'node6', job_id=3D'stream') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node6' is not a backing image of 'node4'") =20 # Error: the base node is the same as the top node result =3D self.vm.qmp('block-stream', device=3D'node4', base_node= =3D'node4', job_id=3D'stream') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "Node 'node4' is not a backing image of 'node4'") =20 # Error: cannot specify 'base' and 'base-node' at the same time result =3D self.vm.qmp('block-stream', device=3D'node4', base=3Dse= lf.imgs[2], base_node=3D'node2', job_id=3D'stream') - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', + "'base' and 'base-node' cannot be specified at the same time") =20 # Success: the base node is a backing file of the top node result =3D self.vm.qmp('block-stream', device=3D'node4', base_node= =3D'node2', job_id=3D'stream') @@ -873,7 +891,7 @@ class TestSetSpeed(iotests.QMPTestCase): self.assert_no_active_block_jobs() =20 result =3D self.vm.qmp('block-stream', device=3D'drive0', speed=3D= -1) - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', "Invalid parameter 'speed'") =20 self.assert_no_active_block_jobs() =20 @@ -882,7 +900,7 @@ class TestSetSpeed(iotests.QMPTestCase): self.assert_qmp(result, 'return', {}) =20 result =3D self.vm.qmp('block-job-set-speed', device=3D'drive0', s= peed=3D-1) - self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', "Invalid parameter 'speed'") =20 self.cancel_and_wait(resume=3DTrue) =20 --=20 2.21.0 From nobody Sat May 18 10:57:18 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=1561675203; cv=none; d=zoho.com; s=zohoarc; b=bGkQLXkJt1w6jQpnI7v1TPSw/ojKkYhzRKInbmwU6AI1QJ9MO+fMsWg1bysdDCckUlmar/wBub4jTeyOumfgAZbOjQAyM2OSr0+VEcKTZ7wDVUIZCcgz1LN/+8p/3lfZQ0BVXm0I33RVAowzHrmoqqXDMtw41Gccogc7nMcOHSw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561675203; h=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:ARC-Authentication-Results; bh=dqCBNR2ZpsMODeQJbLH7mpb63m8LUXyFTWK5vRXK288=; b=WuyZMNyBtl4j8bl2SKydqrjMi67+muGP/NVoy6vd3eT7+9v5uKcaJlgw0hY0ph+LX0+t4XiabCooTyjT75uo5A2Ko7VwV9uVVZXxm2eRJuqu03m0Up4ZODYwc5FTat8+Wwo+uvpWWAXE6P0n/fQvqGkqNPm8AwLTGXozsDQMF3o= 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 1561675203474661.5686880786373; Thu, 27 Jun 2019 15:40:03 -0700 (PDT) Received: from localhost ([::1]:55108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgd3W-0007U5-JA for importer@patchew.org; Thu, 27 Jun 2019 18:39:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44257) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgcxS-0000Qg-VG for qemu-devel@nongnu.org; Thu, 27 Jun 2019 18:33:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgcxQ-0004I7-Np for qemu-devel@nongnu.org; Thu, 27 Jun 2019 18:33:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58880) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hgcxM-00046y-5i; Thu, 27 Jun 2019 18:33:28 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 22A2A3082E6A; Thu, 27 Jun 2019 22:33:25 +0000 (UTC) Received: from localhost (ovpn-204-47.brq.redhat.com [10.40.204.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 473905D719; Thu, 27 Jun 2019 22:33:22 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Fri, 28 Jun 2019 00:32:54 +0200 Message-Id: <20190627223255.3789-5-mreitz@redhat.com> In-Reply-To: <20190627223255.3789-1-mreitz@redhat.com> References: <20190627223255.3789-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 27 Jun 2019 22:33:25 +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 4/5] iotests: Add @use_log to VM.run_job() 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 , Alberto Garcia , qemu-devel@nongnu.org, Max Reitz , Andrey Shinkevich , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" unittest-style tests generally do not use the log file, but VM.run_job() can still be useful to them. Add a parameter to it that hides its output from the log file. Signed-off-by: Max Reitz --- tests/qemu-iotests/iotests.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 3ecef5bc90..ce74177ab1 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -542,7 +542,7 @@ class VM(qtest.QEMUQtestMachine): =20 # Returns None on success, and an error string on failure def run_job(self, job, auto_finalize=3DTrue, auto_dismiss=3DFalse, - pre_finalize=3DNone, wait=3D60.0): + pre_finalize=3DNone, use_log=3DTrue, wait=3D60.0): match_device =3D {'data': {'device': job}} match_id =3D {'data': {'id': job}} events =3D [ @@ -557,7 +557,8 @@ class VM(qtest.QEMUQtestMachine): while True: ev =3D filter_qmp_event(self.events_wait(events)) if ev['event'] !=3D 'JOB_STATUS_CHANGE': - log(ev) + if use_log: + log(ev) continue status =3D ev['data']['status'] if status =3D=3D 'aborting': @@ -565,13 +566,20 @@ class VM(qtest.QEMUQtestMachine): for j in result['return']: if j['id'] =3D=3D job: error =3D j['error'] - log('Job failed: %s' % (j['error'])) + if use_log: + log('Job failed: %s' % (j['error'])) elif status =3D=3D 'pending' and not auto_finalize: if pre_finalize: pre_finalize() - self.qmp_log('job-finalize', id=3Djob) + if use_log: + self.qmp_log('job-finalize', id=3Djob) + else: + self.qmp('job-finalize', id=3Djob) elif status =3D=3D 'concluded' and not auto_dismiss: - self.qmp_log('job-dismiss', id=3Djob) + if use_log: + self.qmp_log('job-dismiss', id=3Djob) + else: + self.qmp('job-dismiss', id=3Djob) elif status =3D=3D 'null': return error =20 --=20 2.21.0 From nobody Sat May 18 10:57:18 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=1561675085; cv=none; d=zoho.com; s=zohoarc; b=EWY7z5pQYujMSD1S2vpDF3LJ+F8lA1rhsoKuNbdgNz9/3d2xorf1nlHuYiXlcVwLDT6idd3UVG4+osgHwhaIQpx2r3UO2p4aUIBlbyJ6RihDzQPHbz3rP1XD1MSjvQ4skU4JXKf6brtZwYzxncXe4fOPbF9yKT9BwgMEdAYY/fc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561675085; h=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:ARC-Authentication-Results; bh=L2OJPu4gzLD79YxNkIz/D2yVunyUiIycNmFq3NadIKk=; b=blU96TeED5jRCFNUi0Kt9atN9ihRTo6TA11oPDspx8StUhfDnTYNgeOwRYlNHCJAqF6ARZg4oo76D7182EffehY9SmYMVX2khH+KE3xIa6QzpWQFs9k5ePvNYLMLjyJ1jWJkcnSoWfqNt4iMBP4PfjKj7kCAknQ2yfCHL3OPfgE= 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 1561675085495416.3269251881053; Thu, 27 Jun 2019 15:38:05 -0700 (PDT) Received: from localhost ([::1]:55092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgd1f-0005Cf-83 for importer@patchew.org; Thu, 27 Jun 2019 18:37:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44283) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgcxU-0000Sr-Vs for qemu-devel@nongnu.org; Thu, 27 Jun 2019 18:33:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgcxT-0004Lt-Qn for qemu-devel@nongnu.org; Thu, 27 Jun 2019 18:33:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45878) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hgcxO-0004EF-IL; Thu, 27 Jun 2019 18:33:30 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A0FAA308FEDF; Thu, 27 Jun 2019 22:33:29 +0000 (UTC) Received: from localhost (ovpn-204-47.brq.redhat.com [10.40.204.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 089D010018F9; Thu, 27 Jun 2019 22:33:26 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Fri, 28 Jun 2019 00:32:55 +0200 Message-Id: <20190627223255.3789-6-mreitz@redhat.com> In-Reply-To: <20190627223255.3789-1-mreitz@redhat.com> References: <20190627223255.3789-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Thu, 27 Jun 2019 22:33:29 +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 5/5] iotests: Add new case to 030 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 , Alberto Garcia , qemu-devel@nongnu.org, Max Reitz , Andrey Shinkevich , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We recently removed the dependency of the stream job on its base node. That makes it OK to use a commit filter node there. Test that. Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia Tested-by: Andrey Shinkevich --- tests/qemu-iotests/030 | 25 +++++++++++++++++++++++++ tests/qemu-iotests/030.out | 4 ++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index 10fe1de89d..a0397072bc 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -363,6 +363,31 @@ class TestParallelOps(iotests.QMPTestCase): self.wait_until_completed() self.assert_no_active_block_jobs() =20 + # In this case the base node of the stream job is the commit job's + # filter node. stream does not have a real dependency on its base + # node, so even though commit removes it when it is done, there is + # no conflict. + def test_overlapping_5(self): + self.assert_no_active_block_jobs() + + # Commit from node2 into node0 + result =3D self.vm.qmp('block-commit', device=3D'drive0', + top_node=3D'node2', base_node=3D'node0', + filter_node_name=3D'commit-filter', speed=3D1= 024*1024) + self.assert_qmp(result, 'return', {}) + + # Stream from node2 into node4 + result =3D self.vm.qmp('block-stream', device=3D'node4', + base_node=3D'commit-filter', job_id=3D'node4') + self.assert_qmp(result, 'return', {}) + + result =3D self.vm.qmp('block-job-set-speed', device=3D'drive0', s= peed=3D0) + self.assert_qmp(result, 'return', {}) + + self.vm.run_job(job=3D'drive0', auto_dismiss=3DTrue, use_log=3DFal= se) + self.vm.run_job(job=3D'node4', auto_dismiss=3DTrue, use_log=3DFals= e) + self.assert_no_active_block_jobs() + # Test a block-stream and a block-commit job in parallel # Here the stream job is supposed to finish quickly in order to reprod= uce # the scenario that triggers the bug fixed in 3d5d319e1221 and 1a63a90= 7507 diff --git a/tests/qemu-iotests/030.out b/tests/qemu-iotests/030.out index 4fd1c2dcd2..5eb508de07 100644 --- a/tests/qemu-iotests/030.out +++ b/tests/qemu-iotests/030.out @@ -1,5 +1,5 @@ -......................... +.......................... ---------------------------------------------------------------------- -Ran 25 tests +Ran 26 tests =20 OK --=20 2.21.0