qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 10/19] block: Drain recursively with a single BD


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 10/19] block: Drain recursively with a single BDRV_POLL_WHILE()
Date: Thu, 12 Apr 2018 10:41:22 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 11/04/2018 18:39, Kevin Wolf wrote:
> +    if (atomic_read(&bs->in_flight)) {
> +        return true;
> +    }
> +
> +    if (recursive) {
> +        QLIST_FOREACH_SAFE(child, &bs->children, next, next) {

QLIST_FOREACH_SAFE is only safe if child disappears, but not if e.g.
next disappears.  So this loop is only safe because top_level is false
below.  Sounds like another good reason to split the top_level == false
case into a separate function.

Paolo

> +            if (bdrv_drain_poll(child->bs, false, recursive)) {
> +                return true;
> +            }
> +        }




reply via email to

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