diff options
author | Kevin Wolf <kwolf@redhat.com> | 2023-05-25 14:47:05 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2023-05-30 17:21:23 +0200 |
commit | 4c20dd24b1178c78c47bf323173360b85e65e1e1 (patch) | |
tree | 625f8938dd6f5004d54c4f609f178dd239fa8590 /block/mirror.c | |
parent | c6e0a6de62c5fa99ef06a9bb49c8072bcf93f431 (diff) |
block-backend: Fix blk_new_open() for iothreads
This fixes blk_new_open() to not assume that bs is in the main context.
In particular, the BlockBackend must be created with the right
AioContext because it will refuse to move to a different context
afterwards. (blk->allow_aio_context_change is false.)
Use this opportunity to use blk_insert_bs() instead of duplicating the
bdrv_root_attach_child() call. This is consistent with what
blk_new_with_bs() does. Add comments to document the locking rules.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20230525124713.401149-5-kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/mirror.c')
0 files changed, 0 insertions, 0 deletions