qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4] vhsot-user: Do not wait for reply for not sent VHOST_USER_SET_LOG_BASE
@ 2024-09-18  7:19 xiangwencheng
  0 siblings, 0 replies; only message in thread
From: xiangwencheng @ 2024-09-18  7:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: mst, BillXiang

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 --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



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-09-18 13:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-18  7:19 [PATCH v4] vhsot-user: Do not wait for reply for not sent VHOST_USER_SET_LOG_BASE xiangwencheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).