]> git.ipfire.org Git - thirdparty/qemu.git/commit
block/monitor: Fix crash when executing HMP commit
authorWang Liang <wangliangzz@inspur.com>
Mon, 24 Apr 2023 10:39:02 +0000 (18:39 +0800)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 10 May 2023 17:50:38 +0000 (20:50 +0300)
commitf528cfc3fa91dacc0f5e0bf494164f7d4548e35f
treec35721f15d352525f433a04563b9dda93682b152
parentbb47b5bc2e7a1e7e12c542b8e6510fa37c23b659
block/monitor: Fix crash when executing HMP commit

hmp_commit() calls blk_is_available() from a non-coroutine context (and
in the main loop). blk_is_available() is a co_wrapper_mixed_bdrv_rdlock
function, and in the non-coroutine context it calls AIO_WAIT_WHILE(),
which crashes if the aio_context lock is not taken before.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1615
Signed-off-by: Wang Liang <wangliangzz@inspur.com>
Message-Id: <20230424103902.45265-1-wangliangzz@126.com>
Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 8c1e8fb2e7fc2cbeb57703e143965a4cd3ad301a)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
block/monitor/block-hmp-cmds.c