On Mon, 11/09 10:24, Paolo Bonzini wrote:
>
>
> On 09/11/2015 03:56, Fam Zheng wrote:
> > + if (bs->drv && bs->drv->bdrv_drain) {
> > + bs->drv->bdrv_drain(bs);
> > + }
> > + QLIST_FOREACH(child, &bs->children, next) {
> > + BlockDriverState *cbs = child->bs;
> > + if (cbs->drv && cbs->drv->bdrv_drain) {
> > + cbs->drv->bdrv_drain(bs);
> > + }
> > + }
>
> I think this is not enough, because the children could have children as
> well.
>
> Perhaps you can do it like bdrv_flush: one function does the call to
> bdrv_drain and the recursion on children; bdrv_drain calls that one
> function and then does the "while (busy)" loop.
>
Right, this function is no longer recursive and only goes to one layer down.
Will fix.
Thanks,
Fam