diff mbox series

[v4] vhsot-user: Do not wait for reply for not sent VHOST_USER_SET_LOG_BASE

Message ID 20240918071930.28771-1-xiangwencheng@gmail.com (mailing list archive)
State New
Headers show
Series [v4] vhsot-user: Do not wait for reply for not sent VHOST_USER_SET_LOG_BASE | expand

Commit Message

bill xiang Sept. 18, 2024, 7:19 a.m. UTC
From: BillXiang <xiangwencheng@gmail.com>

Clean up commit 7c211eb078c4 ("vhost-user: Skip unnecessary duplicated 
VHOST_USER_SET_LOG_BASE requests") which has added VHOST_USER_SET_LOG_BASE
to vhost_user_per_device_request and will not send it in vhost_user_write
when vq_index != 0 but still wait for replies in vhost_user_set_log_base
for those not sent msgs which will cause qemu hangs up.
So we add check in this patch to read reply only when vq_index == 0.


Signed-off-by: BillXiang <xiangwencheng@gmail.com>
---
V3[1] -> V4:
 - rewrite the commit log to make it clear

[1]https://lists.nongnu.org/archive/html/qemu-devel/2024-09/msg01852.html
---
 hw/virtio/vhost-user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index 00561daa06..fd12992d15 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -460,7 +460,7 @@  static int vhost_user_set_log_base(struct vhost_dev *dev, uint64_t base,
         return ret;
     }
 
-    if (shmfd) {
+    if (shmfd && dev->vq_index == 0) {
         msg.hdr.size = 0;
         ret = vhost_user_read(dev, &msg);
         if (ret < 0) {