On 05.02.20 16:24, Eric Blake wrote: > On 2/4/20 11:08 AM, Max Reitz wrote: >> This enum will supplement BdrvChildClass when it comes to what role (or >> combination of roles) a child takes for its parent. >> >> Because empty enums are not allowed, let us just start with it filled. >> >> Signed-off-by: Max Reitz <mre...@redhat.com> >> --- >> include/block/block.h | 27 +++++++++++++++++++++++++++ >> 1 file changed, 27 insertions(+) >> >> diff --git a/include/block/block.h b/include/block/block.h >> index 38963ef203..0f7e8caa5b 100644 >> --- a/include/block/block.h >> +++ b/include/block/block.h >> @@ -279,6 +279,33 @@ enum { >> DEFAULT_PERM_UNCHANGED = BLK_PERM_ALL & >> ~DEFAULT_PERM_PASSTHROUGH, >> }; >> +typedef enum BdrvChildRole { >> + /* Child stores data */ >> + BDRV_CHILD_DATA = (1 << 0), >> + >> + /* Child stores metadata */ >> + BDRV_CHILD_METADATA = (1 << 1), >> + >> + /* Filtered child */ >> + BDRV_CHILD_FILTERED = (1 << 2), > > I'm not sure this comment does justice for what the flag represents, but > am not sure of what longer comment to put in its place.
You’re right. I thought I could just rely on our .is_filter documentation (at least after https://lists.gnu.org/archive/html/qemu-devel/2019-08/msg01721.html), but that doesn’t really apply here. For example, this series makes raw (without further parameters) have a CHILD_FILTERED child, without raw being a filter itself. So there should indeed be some definition here. Maybe: A child to which the parent forwards all reads and writes. Therefore, this child presents exactly the same visible data as the parent. Would that work? Max
signature.asc
Description: OpenPGP digital signature