block: Fix locking in external_snapshot_prepare()
commite13550558840422f980a0a71efe52ee83f37933d
authorKevin Wolf <kwolf@redhat.com>
Wed, 7 Dec 2022 13:18:30 +0000 (7 14:18 +0100)
committerKevin Wolf <kwolf@redhat.com>
Thu, 15 Dec 2022 15:08:23 +0000 (15 16:08 +0100)
tree4cf1f58f36d862ffb20da02e948f85aa7b5bf64f
parent617f3a963589dbd54fe1f323eeac36411b352a0e
block: Fix locking in external_snapshot_prepare()

bdrv_img_create() polls internally (when calling bdrv_create(), which is
a co_wrapper), so it can't be called while holding the lock of any
AioContext except the current one without causing deadlocks. Drop the
lock around the call in external_snapshot_prepare().

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20221207131838.239125-11-kwolf@redhat.com>
Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c
blockdev.c