Skip to contentSkip to conversation

vhost-user: send set log base message only once

PATCH New Yajun Wu 1 participant 1 message Nov 22, 2022

lore
Share & tools
lore

Yajun Wu

author
#0 lore raw

PATCH 1/1 vhost-user: send set log base message only once

Vhost message VHOST_USER_SET_LOG_BASE is device wide. So only send it once with the first queue pair.

---
 hw/virtio/vhost-user.c | 5 +++++
 1 file changed, 5 insertions(+)
hw/virtio/vhost-user.c +5 -0
index abe23d4ebe..b3bdf7921d 100644
@@ -526,6 +526,11 @@ static int vhost_user_set_log_base(struct vhost_dev *dev, uint64_t base,
         .hdr.size = sizeof(msg.payload.log),
     };
 
+    /* Send only once with first queue pair */
+    if (dev->vq_index != 0) {
+        return 0;
+    }
+
     if (shmfd && log->fd != -1) {
         fds[fd_num++] = log->fd;
     }
Signature · 1 line
2.27.0