[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;
> + }
> + }
- Re: [Qemu-devel] [PATCH 04/19] block: Don't manually poll in bdrv_drain_all(), (continued)
- [Qemu-devel] [PATCH 06/19] block: Avoid unnecessary aio_poll() in AIO_WAIT_WHILE(), Kevin Wolf, 2018/04/11
- [Qemu-devel] [PATCH 09/19] test-bdrv-drain: Add test for node deletion, Kevin Wolf, 2018/04/11
- [Qemu-devel] [PATCH 07/19] block: Really pause block jobs on drain, Kevin Wolf, 2018/04/11
- [Qemu-devel] [PATCH 02/19] block: Use bdrv_do_drain_begin/end in bdrv_drain_all(), Kevin Wolf, 2018/04/11
- [Qemu-devel] [PATCH 01/19] test-bdrv-drain: bdrv_drain() works with cross-AioContext events, Kevin Wolf, 2018/04/11
- [Qemu-devel] [PATCH 11/19] test-bdrv-drain: Test node deletion in subtree recursion, Kevin Wolf, 2018/04/11
- [Qemu-devel] [PATCH 10/19] block: Drain recursively with a single BDRV_POLL_WHILE(), Kevin Wolf, 2018/04/11
- Re: [Qemu-devel] [PATCH 10/19] block: Drain recursively with a single BDRV_POLL_WHILE(),
Paolo Bonzini <=
- [Qemu-devel] [PATCH 15/19] test-bdrv-drain: Test that bdrv_drain_invoke() doesn't poll, Kevin Wolf, 2018/04/11
- [Qemu-devel] [PATCH 12/19] block: Don't poll in parent drain callbacks, Kevin Wolf, 2018/04/11
- [Qemu-devel] [PATCH 13/19] test-bdrv-drain: Graph change through parent callback, Kevin Wolf, 2018/04/11
- [Qemu-devel] [PATCH 14/19] block: Defer .bdrv_drain_begin callback to polling phase, Kevin Wolf, 2018/04/11
- [Qemu-devel] [PATCH 17/19] block: Move bdrv_drain_all_begin() out of coroutine context, Kevin Wolf, 2018/04/11
- [Qemu-devel] [PATCH 19/19] test-bdrv-drain: Test graph changes in drain_all section, Kevin Wolf, 2018/04/11
- [Qemu-devel] [PATCH 18/19] block: Allow graph changes in bdrv_drain_all_begin/end sections, Kevin Wolf, 2018/04/11
- [Qemu-devel] [PATCH 16/19] block: Allow AIO_WAIT_WHILE with NULL ctx, Kevin Wolf, 2018/04/11