qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
To: Max Reitz <mreitz@redhat.com>, Alberto Garcia <berto@igalia.com>,
	Eric Blake <eblake@redhat.com>,
	Wen Congyang <wency@cn.fujitsu.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: qemu devel <qemu-devel@nongnu.org>, Kevin Wolf <kwolf@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Dong Eddie <eddie.dong@intel.com>,
	Jiang Yunhong <yunhong.jiang@intel.com>,
	qemu block <qemu-block@nongnu.org>,
	zhanghailiang <zhang.zhanghailiang@huawei.com>,
	Gonglei <arei.gonglei@huawei.com>
Subject: Re: [Qemu-devel] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()
Date: Mon, 11 Apr 2016 13:18:34 +0800	[thread overview]
Message-ID: <570B33AA.7000902@cn.fujitsu.com> (raw)
In-Reply-To: <56FBEBA3.9070305@redhat.com>

On 03/30/2016 11:07 PM, Max Reitz wrote:
> On 30.03.2016 13:39, Alberto Garcia wrote:
>> On Tue 29 Mar 2016 05:51:22 PM CEST, Max Reitz wrote:
>>>> It sounds like the argument here, and in Max's thread on
>>>> query-block-node-tree, is that we DO have cases where order matters, and
>>>> so we need a way for the hot-add operation to explicitly specify where
>>>> in the list a child is inserted (whether it is being inserted as the new
>>>> primary image, or explicitly as the last resort, or somewhere in the
>>>> middle).  An optional parameter, that defaults to appending, may be ok,
>>>> but we definitely need to consider how the order of children is affected
>>>> by hot-add.
>>>
>>> However, the order should be queriable after the fact, and there are
>>> three ways I see to accomplish this:
>>>
>>> (1) Make this information queriable as driver-specific BDS information.
>>>      I personally don't like it very much, but it would be fine.
>>> (2) Implement query-block-node-tree, make the order of child nodes
>>>      significant and thus represent the FIFO order there. I don't like
>>>      this because it would mean returning two orders through that child
>>>      node list: One is the numeric order (children.0, children.1, ...)
>>>      and another is the FIFO order, which are not necessarily equal.
>>> (3) Fix FIFO order to the child name (its role). I'm very much in favor
>>>      of this.
>>>
>>> While I don't have good arguments against (1), I think I have good
>>> arguments for (3) instead: It just doesn't make sense to have a numeric
>>> order of children if this order doesn't mean anything; especially if you
>>> suddenly do need the list of child nodes to be ordered. To me, it
>>> doesn't make any sense to introduce a new hidden order which takes
>>> precedence over this obvious user-visible order.
>>
>> I'm not sure if I understand correctly what you mean in (3). The
>> user-visible FIFO order is the one specified when the Quorum is created:
>>
>> children.0.file.filename=hd0.qcow2,
>> children.1.file.filename=hd1.qcow2,
>> ...
>>
>> Would you then call those BDS children.0, children.1, etc
>
> They are already called that way; it's not their node name but their
> "child role" name.
>
>>                                                            and make those
>> names be the ones that actually define how they are ordered internally?
>
> Yes, that's what I meant.
>
Hi Max

I think you just mean what i draw in below chart:

1) Insert 4 children.
0           1          2          3
+----------------------------------------------------
|children.0|children.1|children.2|children.3|
+----------------------------------------------------

2) Remove the 2th child (s->children[1])

{ "execute": "x-blockdev-change", 
 

   "arguments": { "parent": "xxx", 
 

                  "child": "children.1" } }

0           1          2          3
+----------------------------------------------------
|children.0|children.1|children.2|children.3|
+------------------------+------------+--------------
                          |            | 	
                   +------+   +--------+
0           1     |    2     |
+----------------v----------v------------------------
|children.0|children.1|children.2|
+----------------------------------------------------

Remove children.1 and shorten the array, then rename children.{2,3} to 
children.{1.2}

3) Insert a new child

0           1          2         3
+----------------------------------------------------
|children.0|children.1|children.2|children.3|
+----------------------------------------------------

But as Wen said: 
http://lists.nongnu.org/archive/html/qemu-devel/2016-04/msg00898.html

Everytime we try to remove a children.i (i < n-1, so it's not the last 
element of the array[n]), we have to rename children.{i+1, n-1} to 
children.{i, n-2}.

Thanks
	-Xie

>> I also have another (not directly related) question: why not simply use
>> the node name when removing children? I understood that the idea was
>> that it's possible to have the same node attached twice to the same
>> Quorum, but can you actually do that? And what's the use case?
>
> What I like about using the child role name is that it automatically
> prevents you from specifying a node that is not a child of the given parent.
>
> Which makes me notice that it might be a good idea to require the user
> to specify the child's role when adding a new child. In this version of
> this series (where only quorum is supported), the children are just
> inserted in numerical order (first free slot is taken first), but maybe
> the user wants to insert them in a different order.
>
> For quorum, this is basically irrelevant if the order doesn't mean
> anything (which I don't like), but it may be relevant for other block
> drivers.
>
> And the "filling up quorum's children" topic then makes me notice that
> (x-)blockdev-change should probably be transaction-able (so you can
> restructure the whole BDS graph in a single transaction), but that's
> something we can care about later on.
>
> Max
>

  parent reply	other threads:[~2016-04-11  5:16 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
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 [this message]
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=570B33AA.7000902@cn.fujitsu.com \
    --to=xiecl.fnst@cn.fujitsu.com \
    --cc=arei.gonglei@huawei.com \
    --cc=armbru@redhat.com \
    --cc=berto@igalia.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.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=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).