qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 08/22] quorum: Store children in own structure


From: Max Reitz
Subject: Re: [PATCH 08/22] quorum: Store children in own structure
Date: Thu, 26 Sep 2019 13:07:19 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0

On 25.09.19 15:21, Vladimir Sementsov-Ogievskiy wrote:
> 20.09.2019 18:27, Max Reitz wrote:

[...]

>> @@ -1022,8 +1028,10 @@ static void quorum_add_child(BlockDriverState *bs, 
>> BlockDriverState *child_bs,
>>           s->next_child_index--;
>>           goto out;
>>       }
> 
> more context:
>      assert(s->num_children <= INT_MAX / sizeof(BdrvChild *));
>      if (s->num_children == INT_MAX / sizeof(BdrvChild *) ||
>          s->next_child_index == UINT_MAX) {
>          error_setg(errp, "Too many children");
>          return;
>      }
> 
> here: s/BdrvChild */QuorumChild
> 
> 
>> -    s->children = g_renew(BdrvChild *, s->children, s->num_children + 1);
>> -    s->children[s->num_children++] = child;
>> +    s->children = g_renew(QuorumChild, s->children, s->num_children + 1);
>> +    s->children[s->num_children++] = (QuorumChild){
>> +        .child = child,
>> +    };
>>   
>>   out:
>>       bdrv_drained_end(bs);

[...]

>> @@ -1059,7 +1067,7 @@ static void quorum_del_child(BlockDriverState *bs, 
>> BdrvChild *child,
>>       /* We can safely remove this child now */
>>       memmove(&s->children[i], &s->children[i + 1],
>>               (s->num_children - i - 1) * sizeof(BdrvChild *));
> 
> s/BdrvChild */QuorumChild/

Damn, yes to both.

I was really hoping I didn’t mess this patch up.

Thanks.

Max

>> -    s->children = g_renew(BdrvChild *, s->children, --s->num_children);
>> +    s->children = g_renew(QuorumChild, s->children, --s->num_children);
>>       bdrv_unref_child(bs, child);
>>   
>>       bdrv_drained_end(bs);
>> @@ -1100,7 +1108,7 @@ static void 
>> quorum_gather_child_options(BlockDriverState *bs, QDict *target,
>>   
>>       for (i = 0; i < s->num_children; i++) {
>>           qlist_append(children_list,
>> -                     qobject_ref(s->children[i]->bs->full_open_options));
>> +                     
>> qobject_ref(s->children[i].child->bs->full_open_options));
>>       }
>>   }
>>   
>>
> 
> with my suggestions:
> Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> 


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]