From: BillXiang <xiangwench...@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 <xiangwench...@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 --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) {
-- 
2.30.0


Reply via email to