From nobody Thu Nov 6 19:04:18 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1488226855266398.4996696487834; Mon, 27 Feb 2017 12:20:55 -0800 (PST) Received: from localhost ([::1]:56560 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciRmv-0008V4-J9 for importer@patchew.org; Mon, 27 Feb 2017 15:20:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56756) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciRcb-0007n7-N8 for qemu-devel@nongnu.org; Mon, 27 Feb 2017 15:10:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciRca-0002zD-OG for qemu-devel@nongnu.org; Mon, 27 Feb 2017 15:10:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47680) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ciRcW-0002wy-Mt; Mon, 27 Feb 2017 15:10:08 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E38718553C; Mon, 27 Feb 2017 20:10:08 +0000 (UTC) Received: from noname.redhat.com (ovpn-116-148.ams2.redhat.com [10.36.116.148]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1RK9n8J003294; Mon, 27 Feb 2017 15:10:06 -0500 From: Kevin Wolf To: qemu-block@nongnu.org Date: Mon, 27 Feb 2017 21:09:07 +0100 Message-Id: <1488226184-9044-7-git-send-email-kwolf@redhat.com> In-Reply-To: <1488226184-9044-1-git-send-email-kwolf@redhat.com> References: <1488226184-9044-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 27 Feb 2017 20:10:08 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 06/43] block: Request child permissions in filter drivers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, jcody@redhat.com, famz@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" All callers will have to request permissions for all of their child nodes. Block drivers that act as simply filters can use the default implementation of .bdrv_child_perm(). Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- block/blkdebug.c | 2 ++ block/blkreplay.c | 1 + block/blkverify.c | 1 + block/quorum.c | 2 ++ block/raw-format.c | 1 + block/replication.c | 1 + 6 files changed, 8 insertions(+) diff --git a/block/blkdebug.c b/block/blkdebug.c index 6117ce5..67e8024 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -734,6 +734,8 @@ static BlockDriver bdrv_blkdebug =3D { .bdrv_file_open =3D blkdebug_open, .bdrv_close =3D blkdebug_close, .bdrv_reopen_prepare =3D blkdebug_reopen_prepare, + .bdrv_child_perm =3D bdrv_filter_default_perms, + .bdrv_getlength =3D blkdebug_getlength, .bdrv_truncate =3D blkdebug_truncate, .bdrv_refresh_filename =3D blkdebug_refresh_filename, diff --git a/block/blkreplay.c b/block/blkreplay.c index cfc8c5b..e110211 100755 --- a/block/blkreplay.c +++ b/block/blkreplay.c @@ -137,6 +137,7 @@ static BlockDriver bdrv_blkreplay =3D { =20 .bdrv_file_open =3D blkreplay_open, .bdrv_close =3D blkreplay_close, + .bdrv_child_perm =3D bdrv_filter_default_perms, .bdrv_getlength =3D blkreplay_getlength, =20 .bdrv_co_preadv =3D blkreplay_co_preadv, diff --git a/block/blkverify.c b/block/blkverify.c index 43a940c..9a1e21c 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -320,6 +320,7 @@ static BlockDriver bdrv_blkverify =3D { .bdrv_parse_filename =3D blkverify_parse_filename, .bdrv_file_open =3D blkverify_open, .bdrv_close =3D blkverify_close, + .bdrv_child_perm =3D bdrv_filter_default_perms, .bdrv_getlength =3D blkverify_getlength, .bdrv_refresh_filename =3D blkverify_refresh_filename, =20 diff --git a/block/quorum.c b/block/quorum.c index bdbcec6..40205fb 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -1133,6 +1133,8 @@ static BlockDriver bdrv_quorum =3D { .bdrv_add_child =3D quorum_add_child, .bdrv_del_child =3D quorum_del_child, =20 + .bdrv_child_perm =3D bdrv_filter_default_perms, + .is_filter =3D true, .bdrv_recurse_is_first_non_filter =3D quorum_recurse_is_first_non_fi= lter, }; diff --git a/block/raw-format.c b/block/raw-format.c index ce34d1b..86fbc65 100644 --- a/block/raw-format.c +++ b/block/raw-format.c @@ -467,6 +467,7 @@ BlockDriver bdrv_raw =3D { .bdrv_reopen_abort =3D &raw_reopen_abort, .bdrv_open =3D &raw_open, .bdrv_close =3D &raw_close, + .bdrv_child_perm =3D bdrv_filter_default_perms, .bdrv_create =3D &raw_create, .bdrv_co_preadv =3D &raw_co_preadv, .bdrv_co_pwritev =3D &raw_co_pwritev, diff --git a/block/replication.c b/block/replication.c index eff85c7..91465cb 100644 --- a/block/replication.c +++ b/block/replication.c @@ -660,6 +660,7 @@ BlockDriver bdrv_replication =3D { =20 .bdrv_open =3D replication_open, .bdrv_close =3D replication_close, + .bdrv_child_perm =3D bdrv_filter_default_perms, =20 .bdrv_getlength =3D replication_getlength, .bdrv_co_readv =3D replication_co_readv, --=20 1.8.3.1