From nobody Sun Feb 8 12:38:39 2026 Delivered-To: importer@patchew.org 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; 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=1576745655; cv=none; d=zohomail.com; s=zohoarc; b=H78WWhyphhV/FzgBIrbZu7waOA3mbydSwnX4+rIYza55LZXHup2GBF12fG5dCew7hVpSL5puHpbuQOFeHMxtViQL1ut9onWUCtuOrherMzS++cfvAQYOSkezMPVsx20j/Vf8OCY+jl42nqhN2+w73S2/Wx8BGTCDZhaH2UMH9+w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576745655; 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; bh=zSEpFav88boy9Va0fiYNdggCWhpwDwckS3it5Wi6p2o=; b=Kf3xj1ACxVmM5+lod61dSYWwsEvJaVdhvtExW7Vp/ntrzbNN45VQeOtNV+x75ggdoHnIsOs+pr4hN8ZxJJTV6LSgG/qxHJfc5+G3S/qde9wjd3oK2JxCURkkp8ohIay+bMITNhu0R/6AP38Kt6cWXaA62vrwGstMP+gwXGG/F/c= 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 1576745655296935.261945384729; Thu, 19 Dec 2019 00:54:15 -0800 (PST) Received: from localhost ([::1]:37406 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihrZW-0002Vk-5S for importer@patchew.org; Thu, 19 Dec 2019 03:54:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36574) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihrWj-00071B-Re for qemu-devel@nongnu.org; Thu, 19 Dec 2019 03:51:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihrWi-00050Y-HY for qemu-devel@nongnu.org; Thu, 19 Dec 2019 03:51:21 -0500 Received: from relay.sw.ru ([185.231.240.75]:55346) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ihrWf-0004Xj-67; Thu, 19 Dec 2019 03:51:17 -0500 Received: from vovaso.qa.sw.ru ([10.94.3.0] helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1ihrWU-0004DF-KO; Thu, 19 Dec 2019 11:51:06 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v2 1/5] block: Mark commit and mirror as filter drivers Date: Thu, 19 Dec 2019 11:51:02 +0300 Message-Id: <20191219085106.22309-2-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191219085106.22309-1-vsementsov@virtuozzo.com> References: <20191219085106.22309-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, dgilbert@redhat.com, stefanha@redhat.com, den@openvz.org, mreitz@redhat.com, jsnow@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] Reviewed-by: Eric Blake --- 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 dd033d0b37..964ce58481 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 23c90b3b91..9b455c4285 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 f0f2d9dff1..8cbbe1e065 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1505,6 +1505,8 @@ static BlockDriver bdrv_mirror_top =3D { .bdrv_co_block_status =3D bdrv_co_block_status_from_backing, .bdrv_refresh_filename =3D bdrv_mirror_top_refresh_filename, .bdrv_child_perm =3D bdrv_mirror_top_child_perm, + + .is_filter =3D true, }; =20 static BlockJob *mirror_start_job( --=20 2.21.0