qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Wen Congyang <wency@cn.fujitsu.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Changlong Xie <xiecl.fnst@cn.fujitsu.com>,
	Alberto Garcia <berto@igalia.com>,
	zhanghailiang <zhang.zhanghailiang@huawei.com>,
	qemu block <qemu-block@nongnu.org>,
	Markus Armbruster <armbru@redhat.com>,
	Jiang Yunhong <yunhong.jiang@intel.com>,
	Dong Eddie <eddie.dong@intel.com>,
	qemu devel <qemu-devel@nongnu.org>, Max Reitz <mreitz@redhat.com>,
	Gonglei <arei.gonglei@huawei.com>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()
Date: Thu, 17 Mar 2016 09:48:31 +0000	[thread overview]
Message-ID: <20160317094831.GA2504@work-vm> (raw)
In-Reply-To: <56EA7C62.3090000@cn.fujitsu.com>

* Wen Congyang (wency@cn.fujitsu.com) wrote:
> On 03/17/2016 05:10 PM, Alberto Garcia wrote:
> > On Thu 17 Mar 2016 02:22:40 AM CET, Wen Congyang <wency@cn.fujitsu.com> 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.
> > 
> > Kevin, do you have an example?
> > 
> >>> - How do you obtain the child name?
> >>
> >> IIRC, the answer is no now. I think we can improve 'info block' output
> > 
> > Okay, but then we should extend that first, otherwise this API cannot be
> > used.
> > 
> >>> - 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.
> > 
> > And don't you need a way to control the order in which the disks must be
> > read for COLO?
> 
> I think in fifo mode, we should read the disk first that is added earlier.
> 
> We don't need a way to control the order now.

Can you document fully how it's used in COLO then?
We should have the failure modes documented, and how you'll use
it after failover etc   Without that it's really difficult to tell
if this naming is right.
The children.0 notation is really confusing in the way that Berto
describes; I hit this a couple of months ago and it really doesn't
make sense.

Dave

> 
> Thanks
> Wen Congyang
> 
> > 
> > Berto
> > 
> > 
> > .
> > 
> 
> 
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  reply	other threads:[~2016-03-17  9:48 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-10  2:49 [Qemu-devel] [PATCH v12 0/3] qapi: child add/delete support Changlong Xie
2016-03-10  2:49 ` [Qemu-devel] [PATCH v12 1/3] Add new block driver interface to add/delete a BDS's child Changlong Xie
2016-03-10 14:57   ` Alberto Garcia
2016-03-11  1:17     ` Changlong Xie
2016-03-10  2:49 ` [Qemu-devel] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child() Changlong Xie
2016-03-11 12:21   ` Alberto Garcia
2016-03-14  1:33     ` Changlong Xie
2016-03-14  6:02     ` Changlong Xie
2016-03-16 12:38       ` Alberto Garcia
2016-03-17  1:22         ` Wen Congyang
2016-03-17  9:10           ` Alberto Garcia
2016-03-17  9:44             ` Wen Congyang
2016-03-17  9:48               ` Dr. David Alan Gilbert [this message]
2016-03-17  9:56                 ` Wen Congyang
2016-03-17  9:59                   ` Dr. David Alan Gilbert
2016-03-17 10:07                   ` Alberto Garcia
2016-03-17 10:23                     ` Wen Congyang
2016-03-17 11:25                       ` Dr. David Alan Gilbert
2016-03-18  2:56                         ` Wen Congyang
2016-03-18 10:48                           ` Dr. David Alan Gilbert
2016-03-29 15:38                   ` Max Reitz
2016-03-29 15:44                     ` Eric Blake
2016-03-29 15:50                       ` Dr. David Alan Gilbert
2016-03-29 15:52                         ` Max Reitz
2016-03-29 15:54                           ` Dr. David Alan Gilbert
2016-03-29 15:59                             ` Max Reitz
2016-03-29 16:03                               ` Dr. David Alan Gilbert
2016-03-29 16:09                                 ` Max Reitz
2016-03-29 17:33                                   ` Dr. David Alan Gilbert
2016-03-29 15:51                       ` Max Reitz
2016-03-30 11:39                         ` Alberto Garcia
2016-03-30 15:07                           ` Max Reitz
2016-03-31 11:42                             ` Alberto Garcia
2016-03-31 12:31                               ` Dr. David Alan Gilbert
2016-04-01 15:20                               ` Max Reitz
2016-04-06  7:48                                 ` Wen Congyang
2016-04-11  5:18                             ` Changlong Xie
2016-04-12 16:21                               ` Max Reitz
2016-03-16  2:10     ` Wen Congyang
2016-03-10  2:49 ` [Qemu-devel] [PATCH v12 3/3] qmp: add monitor command to add/remove a child Changlong Xie
2016-03-11 12:48   ` Alberto Garcia
2016-03-28  6:09   ` Changlong Xie

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=20160317094831.GA2504@work-vm \
    --to=dgilbert@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=armbru@redhat.com \
    --cc=berto@igalia.com \
    --cc=eddie.dong@intel.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=wency@cn.fujitsu.com \
    --cc=xiecl.fnst@cn.fujitsu.com \
    --cc=yunhong.jiang@intel.com \
    --cc=zhang.zhanghailiang@huawei.com \
    /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).