Skip to contentSkip to conversation

vhsot-user: Do not wait for reply for not sent VHOST_USER_SET_LOG_BASE

PATCH New [email protected] 1 participant 1 message Sep 18, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 vhsot-user: Do not wait for reply for not sent VHOST_USER_SET_LOG_BASE

From: BillXiang <[email protected]>

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.

---
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(-)
hw/virtio/vhost-user.c +1 -1
index 00561daa06..fd12992d15 100644
@@ -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) {
Signature · 1 line
2.30.0