[PATCH v2] block/monitor/block-hmp-cmds.c: Fix crash when execute hmp_commit

2023-04-24 Thread wangliangzz
From: Wang Liang 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. Resolv

[PATCH] block/monitor/block-hmp-cmds.c: Fix crash when execute hmp_commit

2023-04-23 Thread wangliangzz
From: Wang Liang We need to get the aio_context before calling the blk_is_available. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1615 Signed-off-by: Wang Liang --- block/monitor/block-hmp-cmds.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/block/mo

[PATCH] ratelimit: restrict the delay time to a non-negative value

2022-09-20 Thread wangliangzz
From: Wang Liang The delay time should never be a negative value. Signed-off-by: Wang Liang --- include/qemu/ratelimit.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qemu/ratelimit.h b/include/qemu/ratelimit.h index 48bf59e857..c8ea855fc1 100644 --- a/include/qem

[PATCH] virtio-pmem: fix virtio_pmem_resp assign problem

2021-03-17 Thread wangliangzz
From: Wang Liang ret in virtio_pmem_resp is a uint32_t variable, which should be assigned using virtio_stl_p. The kernel side driver does not guarantee virtio_pmem_resp to be initialized to zero in advance, So sometimes the flush operation will fail. Signed-off-by: Wang Liang --- hw/virtio/vi