From: Hanna Reitz <hreitz@redhat.com>
To: Vladimir Sementsov-Ogievskiy
<vladimir.sementsov-ogievskiy@openvz.org>,
qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, kwolf@redhat.com, vsementsov@openvz.org,
v.sementsov-og@mail.ru
Subject: Re: [PATCH v5 07/45] block: document connection between child roles and bs->backing/bs->file
Date: Tue, 7 Jun 2022 14:11:48 +0200 [thread overview]
Message-ID: <cda0091d-65ac-f23a-4e12-7b681d655ea2@redhat.com> (raw)
In-Reply-To: <20220330212902.590099-8-vsementsov@openvz.org>
On 30.03.22 23:28, Vladimir Sementsov-Ogievskiy wrote:
> Make the informal rules formal. In further commit we'll add
> corresponding assertions.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
> ---
> include/block/block-common.h | 42 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 42 insertions(+)
>
> diff --git a/include/block/block-common.h b/include/block/block-common.h
> index fdb7306e78..2687a2519c 100644
> --- a/include/block/block-common.h
> +++ b/include/block/block-common.h
> @@ -313,6 +313,48 @@ enum {
> *
> * At least one of DATA, METADATA, FILTERED, or COW must be set for
> * every child.
> + *
> + *
> + * = Connection with bs->children, bs->file and bs->backing fields =
> + *
> + * 1. Filters
> + *
> + * Filter drivers has drv->is_filter = true.
s/has/have/
> + *
> + * Filter driver has exactly one FILTERED|PRIMARY child, any may have other
s/Filter driver/A filter node/?
And s/any/and/, I think.
> + * children which must not have these bits (the example is copy-before-write
> + * filter that also has target DATA child).
Mild style suggestion: “one example is the copy-before write filter,
which also has its target DATA child”
> + *
> + * Filter driver never has COW children.
Maybe “Filter nodes never have COW children.”?
> + *
> + * For all filters except for mirror_top and commit_top, the filtered child is
> + * linked in bs->file, bs->backing is NULL.
> + *
> + * For mirror_top and commit_top filtered child is linked in bs->backing and
s/commit_top filtered/commit_top, the filtered/ (like in the paragraph
above)
> + * their bs->file is NULL. These two filters has drv->filtered_child_is_backing
s/has/have/
> + * = true.
This also applies to the two test drivers in test-bdrv-graph-mod; should
that be mentioned, too?
Or should we just link to filtered_child_is_backing when it comes to the
list of drivers for which this applies, e.g. by rephrasing the two
paragraphs as follows:
For most filters, the filtered child is linked in bs->file, bs->backing
is NULL. For some filters (as an exception), it is the other way
around; those drivers will have drv->filtered_child_is_backing set to
true (see that field’s documentation for what drivers this concerns).
(Just so we don’t duplicate the list of drivers.)
> + *
> + * 2. "raw" driver (block/raw-format.c)
> + *
> + * Formally it's not a filter (drv->is_filter = false)
> + *
> + * bs->backing is always NULL
> + *
> + * Only has one child, linked in bs->file. It's role is either FILTERED|PRIMARY
s/it's/its/
> + * (like filter) either DATA|PRIMARY depending on options.
s/either/or/
> + *
> + * 3. Other drivers
> + *
> + * Doesn't have any FILTERED children.
s/Doesn't/Don't/ (because “drivers” was in plural)
> + *
> + * May have at most one COW child. In this case it's linked in bs->backing.
> + * Otherwise bs->backing is NULL. COW child is never PRIMARY.
> + *
> + * May have at most one PRIMARY child. In this case it's linked in bs->file.
> + * Otherwise bs->file is NULL.
> + *
> + * May also have some other children that don't have neither PRIMARY nor COW
> + * bits set.
I think either “that don't have the PRIMARY or COW bit set" or "that
have neither the PRIMARY nor the COW bit set".
> */
> enum BdrvChildRoleBits {
> /*
Aside from typo/style nit picks, sounds good!
next prev parent reply other threads:[~2022-06-07 12:27 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-30 21:28 [PATCH v5 00/45] Transactional block-graph modifying API Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 01/45] block: BlockDriver: add .filtered_child_is_backing field Vladimir Sementsov-Ogievskiy
2022-06-07 9:57 ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 02/45] block: introduce bdrv_open_file_child() helper Vladimir Sementsov-Ogievskiy
2022-06-07 9:57 ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 03/45] block/blklogwrites: don't care to remove bs->file child on failure Vladimir Sementsov-Ogievskiy
2022-06-07 10:05 ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 04/45] test-bdrv-graph-mod: update test_parallel_perm_update test case Vladimir Sementsov-Ogievskiy
2022-06-07 10:53 ` Hanna Reitz
2022-06-09 13:08 ` Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 05/45] tests-bdrv-drain: bdrv_replace_test driver: declare supports_backing Vladimir Sementsov-Ogievskiy
2022-06-07 10:59 ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 06/45] test-bdrv-graph-mod: fix filters to be filters Vladimir Sementsov-Ogievskiy
2022-06-07 11:22 ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 07/45] block: document connection between child roles and bs->backing/bs->file Vladimir Sementsov-Ogievskiy
2022-06-07 12:11 ` Hanna Reitz [this message]
2022-03-30 21:28 ` [PATCH v5 08/45] block/snapshot: stress that we fallback to primary child Vladimir Sementsov-Ogievskiy
2022-06-07 13:42 ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 09/45] Revert "block: Let replace_child_noperm free children" Vladimir Sementsov-Ogievskiy
2022-06-07 14:03 ` Hanna Reitz
2022-06-07 15:09 ` Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 10/45] Revert "block: Let replace_child_tran keep indirect pointer" Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 11/45] Revert "block: Restructure remove_file_or_backing_child()" Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 12/45] Revert "block: Pass BdrvChild ** to replace_child_noperm" Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 13/45] block: Manipulate bs->file / bs->backing pointers in .attach/.detach Vladimir Sementsov-Ogievskiy
2022-06-07 15:55 ` Hanna Reitz
2022-06-09 13:40 ` Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 14/45] block/snapshot: drop indirection around bdrv_snapshot_fallback_ptr Vladimir Sementsov-Ogievskiy
2022-06-07 15:58 ` Hanna Reitz
2022-06-09 14:44 ` Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 15/45] block: refactor bdrv_remove_file_or_backing_child to bdrv_remove_child Vladimir Sementsov-Ogievskiy
2022-06-08 10:04 ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 16/45] block: drop bdrv_detach_child() Vladimir Sementsov-Ogievskiy
2022-06-08 10:22 ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 17/45] block: drop bdrv_remove_filter_or_cow_child Vladimir Sementsov-Ogievskiy
2022-06-08 10:40 ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 18/45] block: bdrv_refresh_perms(): allow external tran Vladimir Sementsov-Ogievskiy
2022-06-08 10:57 ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 19/45] block: refactor bdrv_list_refresh_perms to allow any list of nodes Vladimir Sementsov-Ogievskiy
2022-06-08 11:27 ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 20/45] block: make permission update functions public Vladimir Sementsov-Ogievskiy
2022-06-08 11:31 ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 21/45] block: add bdrv_try_set_aio_context_tran transaction action Vladimir Sementsov-Ogievskiy
2022-06-08 11:49 ` Hanna Reitz
2022-06-09 14:56 ` Vladimir Sementsov-Ogievskiy
2022-06-13 7:12 ` Hanna Reitz
2022-06-13 7:46 ` Hanna Reitz
2022-06-20 20:57 ` Vladimir Sementsov-Ogievskiy
2022-06-21 11:04 ` Hanna Reitz
2022-06-21 11:44 ` Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 22/45] block: implemet bdrv_unref_tran() Vladimir Sementsov-Ogievskiy
2022-06-13 9:07 ` Hanna Reitz
2022-06-20 21:16 ` Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 23/45] blockdev: refactor transaction to use Transaction API Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 24/45] blockdev: transactions: rename some things Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 25/45] blockdev: qmp_transaction: refactor loop to classic for Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 26/45] blockdev: transaction: refactor handling transaction properties Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 27/45] blockdev: qmp_transaction: drop extra generic layer Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 28/45] qapi: block: add blockdev-del transaction action Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 29/45] block: introduce BDRV_O_NOPERM flag Vladimir Sementsov-Ogievskiy
2022-06-13 9:54 ` Hanna Reitz
2022-06-21 12:11 ` Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 30/45] block: bdrv_insert_node(): use BDRV_O_NOPERM Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 31/45] qapi: block: add blockdev-add transaction action Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 32/45] iotests: add blockdev-add-transaction Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 33/45] block-backend: blk_root(): drop const specifier on return type Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 34/45] block/export: add blk_by_export_id() Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 35/45] block: make bdrv_find_child() function public Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 36/45] block: bdrv_replace_child_bs(): move to external transaction Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 37/45] qapi: add x-blockdev-replace command Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 38/45] qapi: add x-blockdev-replace transaction action Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 39/45] block: bdrv_get_xdbg_block_graph(): report export ids Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 40/45] iotests.py: qemu_img_create: use imgfmt by default Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 41/45] iotests.py: introduce VM.assert_edges_list() method Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 42/45] iotests.py: add VM.qmp_check() helper Vladimir Sementsov-Ogievskiy
2022-03-30 21:29 ` [PATCH v5 43/45] iotests: add filter-insertion Vladimir Sementsov-Ogievskiy
2022-03-30 21:29 ` [PATCH v5 44/45] block: bdrv_open_inherit: create BlockBackend only when necessary Vladimir Sementsov-Ogievskiy
2022-03-30 21:29 ` [PATCH v5 45/45] block/copy-before-write: correct permission scheme Vladimir Sementsov-Ogievskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cda0091d-65ac-f23a-4e12-7b681d655ea2@redhat.com \
--to=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=v.sementsov-og@mail.ru \
--cc=vladimir.sementsov-ogievskiy@openvz.org \
--cc=vsementsov@openvz.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).