From nobody Wed Nov 12 11:51:44 2025 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=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1570204731; cv=none; d=zoho.com; s=zohoarc; b=gGERnquJgDAOiNpOmufIEjfl1B5vCJyJQDcHMjSm2RJ6eqoafMj7571dwugcmhOdX6wW2QzUgnkf+OjwBLt/V8SEE6vtTMeWoGBXnyBWc1uM32fB0qQk+03EvcVOtNLJejwWxW/7tFzI/5wfeWmu/xT8n2VUiEbii1UqROR3SH4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570204731; 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=0+Lq3awMHS82HG6BPDYe6NsYxskMKrOhGjv+DcZIxPU=; b=fkIfWSvPMJqKHzOvHODlXZRyB3DaE6zzlALgFrzdN1DbLWdSAkB/q6SVseW9sDUUlKyhnnd5yWGFde+2qA+DUTB6K8kEIUmgJO/7UWz7lsO77wd2fLZHiF9lr12BBQuNrE8Zwpr3jYmOZ2Nsl4JRD7cxtN8hKNzrnJVA3PxV3zo= 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 1570204731664577.2753205398573; Fri, 4 Oct 2019 08:58:51 -0700 (PDT) Received: from localhost ([::1]:50044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iGPyj-00011y-F7 for importer@patchew.org; Fri, 04 Oct 2019 11:58:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41147) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iGPnj-00037z-8D for qemu-devel@nongnu.org; Fri, 04 Oct 2019 11:47:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iGPnh-0005gc-Tl for qemu-devel@nongnu.org; Fri, 04 Oct 2019 11:47:27 -0400 Received: from relay.sw.ru ([185.231.240.75]:36352) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iGPnR-0005Ed-Hz; Fri, 04 Oct 2019 11:47:21 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iGPnK-00019e-RA; Fri, 04 Oct 2019 18:47:02 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH 1/5] block: Mark commit and mirror as filter drivers Date: Fri, 4 Oct 2019 18:46:57 +0300 Message-Id: <20191004154701.3202-2-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191004154701.3202-1-vsementsov@virtuozzo.com> References: <20191004154701.3202-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 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: fam@euphon.net, kwolf@redhat.com, vsementsov@virtuozzo.com, quintela@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com, stefanha@redhat.com, den@openvz.org, jsnow@redhat.com, dgilbert@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Max Reitz The commit and mirror block nodes are filters, so they should be marked as such. Signed-off-by: Max Reitz Signed-off-by: Vladimir Sementsov-Ogievskiy [squash comment fix from another Max's patch and adjust commit msg] --- include/block/block_int.h | 8 +++++--- block/commit.c | 2 ++ block/mirror.c | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index 0422acdf1c..4af0fa8fe4 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -89,9 +89,11 @@ struct BlockDriver { int instance_size; =20 /* set to true if the BlockDriver is a block filter. Block filters pass - * certain callbacks that refer to data (see block.c) to their bs->fil= e if - * the driver doesn't implement them. Drivers that do not wish to forw= ard - * must implement them and return -ENOTSUP. + * certain callbacks that refer to data (see block.c) to their bs->file + * or bs->backing (whichever one exists) if the driver doesn't impleme= nt + * them. Drivers that do not wish to forward must implement them and r= eturn + * -ENOTSUP. + * Note that filters are not allowed to modify data. */ bool is_filter; /* for snapshots block filter like Quorum can implement the diff --git a/block/commit.c b/block/commit.c index bc8454463d..07e7a3cd0a 100644 --- a/block/commit.c +++ b/block/commit.c @@ -253,6 +253,8 @@ static BlockDriver bdrv_commit_top =3D { .bdrv_co_block_status =3D bdrv_co_block_status_from_backing, .bdrv_refresh_filename =3D bdrv_commit_top_refresh_filename, .bdrv_child_perm =3D bdrv_commit_top_child_perm, + + .is_filter =3D true, }; =20 void commit_start(const char *job_id, BlockDriverState *bs, diff --git a/block/mirror.c b/block/mirror.c index fe984efb90..838781dfaa 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1487,6 +1487,8 @@ static BlockDriver bdrv_mirror_top =3D { .bdrv_refresh_filename =3D bdrv_mirror_top_refresh_filename, .bdrv_child_perm =3D bdrv_mirror_top_child_perm, .bdrv_refresh_limits =3D bdrv_mirror_top_refresh_limits, + + .is_filter =3D true, }; =20 static BlockJob *mirror_start_job( --=20 2.21.0