[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v12 2/3] quorum: implement bdrv_add_child() and
From: |
Wen Congyang |
Subject: |
Re: [Qemu-devel] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child() |
Date: |
Thu, 17 Mar 2016 09:22:40 +0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
On 03/16/2016 08:38 PM, Alberto Garcia wrote:
> On Mon 14 Mar 2016 07:02:08 AM CET, Changlong Xie <address@hidden> wrote:
>
>>>> @@ -81,6 +82,8 @@ typedef struct BDRVQuorumState {
>>>> bool rewrite_corrupted;/* true if the driver must rewrite-on-read
>>>> corrupted
>>>> * block if Quorum is reached.
>>>> */
>>>> + unsigned long *index_bitmap;
>>
>> Hi Berto
>>
>> *NOTE*, In the old version, we just used "bs->node_name", but in the
>> lastest one, as Kevin suggested we introduce
>> "child->child_name"(formart as "children.xxx"), this is the key cause
>> why we need this two functions here.
>
> I'm sorry I missed this discussion earlier. Your code seems technically
> correct but I have several questions:
>
> - I read that one of the reasons for this change is that "In theory, the
> same node could be attached twice to the same parent in different
> roles.". Is there any example of that? What's the use case?
Kevin may know the case.
>
> - How do you obtain the child name?
IIRC, the answer is no now. I think we can improve 'info block' output
>
> - I see that if you have children.0 and children.1 (let's say hd0.qcow2
> and hd1.qcow2), then you remove children.0 and add it again, it will
> keep the 'children.0' name (that's what the bitmap is for if I'm
> understanding it correctly). However the position in the s->children
> array will change because you do memmove() when you remove children.0
> and then add it again to the end of the array.
>
> Initial status:
>
> s->children[0] <--> "children.0" (hd0.qcow2)
> s->children[1] <--> "children.1" (hd1.qcow2)
>
> children.0 (hd0.qcow2) is removed:
>
> s->children[0] <--> "children.1" (hd1.qcow2)
>
> children.0 (hd0.qcow2) is added again:
>
> s->children[0] <--> "children.1" (hd1.qcow2)
> s->children[1] <--> "children.0" (hd0.qcow2)
Yes, it is correct.
>
> Is this correct? Is this the indented behavior? Since you are reading
> in FIFO mode, now hd1.qcow2 will always be read first, so if
> children.1 was the secondary disk, it has just become the primary.
Yes.
Thanks
Wen Congyang
>
> I also think that it would be great to have tests for this
> functionality, but they can be added later.
>
> Thanks,
>
> Berto
>
>
> .
>
- [Qemu-devel] [PATCH v12 0/3] qapi: child add/delete support, Changlong Xie, 2016/03/09
- [Qemu-devel] [PATCH v12 1/3] Add new block driver interface to add/delete a BDS's child, Changlong Xie, 2016/03/09
- [Qemu-devel] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child(), Changlong Xie, 2016/03/09
- Re: [Qemu-devel] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child(), Alberto Garcia, 2016/03/11
- Re: [Qemu-devel] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child(), Changlong Xie, 2016/03/13
- Re: [Qemu-devel] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child(), Changlong Xie, 2016/03/14
- Re: [Qemu-devel] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child(), Alberto Garcia, 2016/03/16
- Re: [Qemu-devel] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child(),
Wen Congyang <=
- Re: [Qemu-devel] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child(), Alberto Garcia, 2016/03/17
- Re: [Qemu-devel] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child(), Wen Congyang, 2016/03/17
- Re: [Qemu-devel] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child(), Dr. David Alan Gilbert, 2016/03/17
- Re: [Qemu-devel] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child(), Wen Congyang, 2016/03/17
- Re: [Qemu-devel] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child(), Dr. David Alan Gilbert, 2016/03/17
- Re: [Qemu-devel] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child(), Alberto Garcia, 2016/03/17
- Re: [Qemu-devel] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child(), Wen Congyang, 2016/03/17
- Re: [Qemu-devel] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child(), Dr. David Alan Gilbert, 2016/03/17
- Re: [Qemu-devel] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child(), Wen Congyang, 2016/03/17
- Re: [Qemu-devel] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child(), Dr. David Alan Gilbert, 2016/03/18