On 29.03.2016 17:44, Eric Blake wrote: > On 03/29/2016 09:38 AM, Max Reitz wrote: >> On 17.03.2016 10:56, Wen Congyang wrote: >>> On 03/17/2016 05:48 PM, Dr. David Alan Gilbert wrote: >> >> [...] >> >>>> 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. >>> >>> Do you mean: read from children.1 first, and then read from children.0 in >>> fifo mode? Yes, the behavior is very strange. >> >> So is this intended or is it not? In >> http://lists.nongnu.org/archive/html/qemu-block/2016-03/msg00526.html >> you said that it is. >> >> I myself would indeed say it is very strange. If I were a user, I would >> not expect this behavior. And as I developer, I think that how a BDS's >> child is used by its parent should solely depend on its role (e.g. >> whether it is "children.0" or "children.1"). > > 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. Max
signature.asc
Description: OpenPGP digital signature