copy-before-write: Fix open with child in iothread
authorKevin Wolf <kwolf@redhat.com>
Thu, 25 May 2023 12:47:09 +0000 (14:47 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 30 May 2023 15:29:35 +0000 (17:29 +0200)
commit9102f2ebdb71809af1c5ee4a4a255927e3dabca4
treef504a4d7d1055e6f7c1aaeee9e04a284b15f7b77
parent6e0121593288252d9e62448578368678eea3446c
copy-before-write: Fix open with child in iothread

The AioContext lock must not be held for bdrv_open_child(), but it is
necessary for the following operations, in particular those using nested
event loops in coroutine wrappers.

Temporarily dropping the main AioContext lock is not necessary because
we know we run in the main thread.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20230525124713.401149-9-kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/copy-before-write.c