qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH v3 8/9] block: Introduce BlockDriver.bdrv_drain


From: Paolo Bonzini
Subject: Re: [Qemu-block] [PATCH v3 8/9] block: Introduce BlockDriver.bdrv_drain callback
Date: Mon, 9 Nov 2015 10:24:14 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0


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.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]