In subject: individual
On 11/8/22 15:37, Kevin Wolf wrote:
bdrv_reopen() and friends use subtree drains as a lazy way of covering
all the nodes they touch. Turns out that this lazy way is a lot more
complicated than just draining the nodes individually, even not
accounting for the additional complexity in the drain mechanism itself.
Simplify the code by switching to draining the individual nodes that are
already managed in the BlockReopenQueue anyway.
Signed-off-by: Kevin Wolf <kw...@redhat.com>
---
block.c | 11 ++++-------
block/replication.c | 6 ------
blockdev.c | 13 -------------
3 files changed, 4 insertions(+), 26 deletions(-)
[..]
bdrv_reopen_queue_free(queue);
- for (p = drained; p; p = p->next) {
- BlockDriverState *bs = p->data;
- AioContext *ctx = bdrv_get_aio_context(bs);
-
- aio_context_acquire(ctx);
In bdrv_reopen_queue_free() we don't have this acquire()/release() pair around
bdrv_drained_end(). We don't need it anymore?
- bdrv_subtree_drained_end(bs);
- aio_context_release(ctx);
- }
- g_slist_free(drained);
}
void qmp_blockdev_del(const char *node_name, Error **errp)
--
Best regards,
Vladimir