summary refs log tree commit diff stats
path: root/include/hw/qdev-core.h
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2023-05-25 14:47:05 +0200
committerKevin Wolf <kwolf@redhat.com>2023-05-30 17:21:23 +0200
commit4c20dd24b1178c78c47bf323173360b85e65e1e1 (patch)
tree625f8938dd6f5004d54c4f609f178dd239fa8590 /include/hw/qdev-core.h
parentc6e0a6de62c5fa99ef06a9bb49c8072bcf93f431 (diff)
downloadfocaccia-qemu-4c20dd24b1178c78c47bf323173360b85e65e1e1.tar.gz
focaccia-qemu-4c20dd24b1178c78c47bf323173360b85e65e1e1.zip
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 'include/hw/qdev-core.h')
0 files changed, 0 insertions, 0 deletions