[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH for-5.0 02/31] block: Add BdrvChildRole
From: |
Max Reitz |
Subject: |
Re: [PATCH for-5.0 02/31] block: Add BdrvChildRole |
Date: |
Thu, 28 Nov 2019 15:00:56 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 |
On 28.11.19 12:24, Vladimir Sementsov-Ogievskiy wrote:
> 28.11.2019 13:52, Max Reitz wrote:
>> On 28.11.19 10:31, Vladimir Sementsov-Ogievskiy wrote:
>>> 27.11.2019 16:15, 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 <address@hidden>
>>>> ---
>>>> include/block/block.h | 38 ++++++++++++++++++++++++++++++++++++++
>>>> 1 file changed, 38 insertions(+)
>>>>
>>>> diff --git a/include/block/block.h b/include/block/block.h
>>>> index 38963ef203..36817d5689 100644
>>>> --- a/include/block/block.h
>>>> +++ b/include/block/block.h
>>>> @@ -279,6 +279,44 @@ enum {
>>>> DEFAULT_PERM_UNCHANGED = BLK_PERM_ALL &
>>>> ~DEFAULT_PERM_PASSTHROUGH,
>>>> };
>>>>
>>>> +typedef enum BdrvChildRole {
>>>
>>> Don't you want to call it just BdrvChildFlags ?
>>> Benefits:
>>>
>>> 1. Do not intersect with old BdrvChildRole.
>>
>> Well, that doesn’t change the fact that the old BdrvChildRole just
>> doesn’t describe a role.
>>
>>> 2. I think, BDRV_CHILD_STAY_AT_NODE is not a role, but just a property or
>>> flag..
>>
>> I can be convinced to let STAY_AT_NODE stay a property of
>> BdrvChildClass. :-)
>
> or BdrvChild if we want it to be property of object, not class.
Sure, but that would then no longer concern this series, I think. (That
is, either I make STAY_AT_NODE a BdrvChildRole in this series, or I just
don’t.)
Max
signature.asc
Description: OpenPGP digital signature
[PATCH for-5.0 01/31] block: Rename BdrvChildRole to BdrvChildClass, Max Reitz, 2019/11/27
[PATCH for-5.0 04/31] block: Pass BdrvChildRole to bdrv_child_perm(), Max Reitz, 2019/11/27
[PATCH for-5.0 03/31] block: Add BdrvChildRole to BdrvChild, Max Reitz, 2019/11/27
[PATCH for-5.0 06/31] block: Keep BDRV_O_NO_IO in *inherited_fmt_options, Max Reitz, 2019/11/27
[PATCH for-5.0 05/31] block: Drop BdrvChildClass.stay_at_node, Max Reitz, 2019/11/27
[PATCH for-5.0 07/31] block: Pass BdrvChildRole to .inherit_options(), Max Reitz, 2019/11/27
[PATCH for-5.0 08/31] block: Unify bdrv_*inherited_options(), Max Reitz, 2019/11/27
[PATCH for-5.0 09/31] block: Unify bdrv_child_cb_attach(), Max Reitz, 2019/11/27