diff options
author | Kevin Wolf <kwolf@redhat.com> | 2022-12-07 14:18:30 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2022-12-15 16:08:23 +0100 |
commit | e13550558840422f980a0a71efe52ee83f37933d (patch) | |
tree | 4cf1f58f36d862ffb20da02e948f85aa7b5bf64f /block.c | |
parent | 617f3a963589dbd54fe1f323eeac36411b352a0e (diff) | |
download | qemu-e13550558840422f980a0a71efe52ee83f37933d.zip qemu-e13550558840422f980a0a71efe52ee83f37933d.tar.gz qemu-e13550558840422f980a0a71efe52ee83f37933d.tar.bz2 |
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>
Diffstat (limited to 'block.c')
-rw-r--r-- | block.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -6924,6 +6924,10 @@ bool bdrv_op_blocker_is_empty(BlockDriverState *bs) return true; } +/* + * Must not be called while holding the lock of an AioContext other than the + * current one. + */ void bdrv_img_create(const char *filename, const char *fmt, const char *base_filename, const char *base_fmt, char *options, uint64_t img_size, int flags, bool quiet, |