From nobody Tue Feb 10 13:17:09 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; dmarc=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1589363875; cv=none; d=zohomail.com; s=zohoarc; b=UvfhWNtTMK4XtSRnhax97jhJ6ktMVDlcAtNS6IQq/Xly8pg9tSk4DsQKlKOPWpCXH/3UOIfDY3lsys6aioCuPVztl+RQEhqqvtRtRVB8O766Td1tsWlBWz5fP6IN0aS5HT5w+Cjm3bBWpK3vZnwEhAMz4qcrrUvfSMC+qzZgkhc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589363875; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=3iktd/mlnrZKHPf28Yb6eNDRaD3hlfAzmTtM+Q9VlCU=; b=LmQcHcaOhsgLyI9QOTkVr8J1KskGrNBnJNfd4cvOoTRAkTfZ3aQf6TQR7xdIcj5S2HdDnBKsfYs9FAiUJ4SjVvynKKPaKH7qHvByIhg9iR70/r4RFFi9gmI03uaSYCNeIGIOVkIukE2DCgU4TzePotJQS3xA46GxjfBAwzEex/0= ARC-Authentication-Results: i=1; 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 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 1589363875192563.4176648385418; Wed, 13 May 2020 02:57:55 -0700 (PDT) Received: from localhost ([::1]:40106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYo9B-0002k4-2H for importer@patchew.org; Wed, 13 May 2020 05:57:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYo2j-00061J-FV; Wed, 13 May 2020 05:51:13 -0400 Received: from relay.sw.ru ([185.231.240.75]:54002) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYo2f-0003ZA-7F; Wed, 13 May 2020 05:51:13 -0400 Received: from dhcp-172-16-25-136.sw.ru ([172.16.25.136] helo=localhost.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1jYo2W-0001e4-0k; Wed, 13 May 2020 12:51:00 +0300 From: Andrey Shinkevich To: qemu-block@nongnu.org Subject: [PATCH v5 09/15] block: prepare block-stream for using COR-filter Date: Wed, 13 May 2020 12:50:50 +0300 Message-Id: <1589363456-1035571-10-git-send-email-andrey.shinkevich@virtuozzo.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1589363456-1035571-1-git-send-email-andrey.shinkevich@virtuozzo.com> References: <1589363456-1035571-1-git-send-email-andrey.shinkevich@virtuozzo.com> 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=185.231.240.75; envelope-from=andrey.shinkevich@virtuozzo.com; helo=relay.sw.ru X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/13 05:51:06 X-ACL-Warn: Detected OS = Linux 3.1-3.10 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, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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: kwolf@redhat.com, fam@euphon.net, vsementsov@virtuozzo.com, armbru@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, andrey.shinkevich@virtuozzo.com, den@openvz.org, mreitz@redhat.com, jsnow@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This patch is the first one in the series where the COR-filter node will be hard-coded for using in the block-stream job. The block jobs may be run in parallel. Exclude conflicts with filter nodes used for a concurrent job while checking for the blocked operations. It incurs changes in the iotests 030::test_overlapping_4 that now passes with no conflict because the stream job does not have a real dependency on its base and on a filter above it. Signed-off-by: Andrey Shinkevich --- blockdev.c | 11 +++++++++-- tests/qemu-iotests/030 | 9 ++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/blockdev.c b/blockdev.c index b3c840e..97c2ba2 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2763,6 +2763,7 @@ void qmp_block_stream(bool has_job_id, const char *jo= b_id, const char *device, Error *local_err =3D NULL; const char *base_name =3D NULL; int job_flags =3D JOB_DEFAULT; + BlockDriverState *bottom_cow_node; =20 if (!has_on_error) { on_error =3D BLOCKDEV_ON_ERROR_REPORT; @@ -2807,8 +2808,14 @@ void qmp_block_stream(bool has_job_id, const char *j= ob_id, const char *device, base_name =3D base_bs->filename; } =20 - /* Check for op blockers in the whole chain between bs and base */ - for (iter =3D bs; iter && iter !=3D base_bs; iter =3D backing_bs(iter)= ) { + bottom_cow_node =3D bdrv_find_overlay(bs, base_bs); + if (!bottom_cow_node) { + error_setg(errp, "bottom node is not found, nothing to stream"); + goto out; + } + /* Check for op blockers in the whole chain between bs and bottom */ + for (iter =3D bs; iter && iter !=3D bdrv_filtered_bs(bottom_cow_node); + iter =3D bdrv_filtered_bs(iter)) { if (bdrv_op_is_blocked(iter, BLOCK_OP_TYPE_STREAM, errp)) { goto out; } diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index 104e3ce..d7638cd 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -368,8 +368,7 @@ 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 this results in the commit filter - # node being part of the stream chain, this is not allowed. + # top node of commit job. def test_overlapping_4(self): self.assert_no_active_block_jobs() =20 @@ -381,13 +380,13 @@ class TestParallelOps(iotests.QMPTestCase): =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/desc', - "Cannot freeze 'backing' link to 'commit-filter'") + self.assert_qmp(result, 'return', {}) =20 result =3D self.vm.qmp('block-job-set-speed', device=3D'drive0', s= peed=3D0) self.assert_qmp(result, 'return', {}) =20 - self.wait_until_completed() + self.vm.run_job(job=3D'drive0', auto_dismiss=3DTrue) + self.vm.run_job(job=3D'node4', auto_dismiss=3DTrue) self.assert_no_active_block_jobs() =20 # In this case the base node of the stream job is the commit job's --=20 1.8.3.1