aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYajun Wu <yajunw@nvidia.com>2022-11-22 13:14:47 +0800
committerMichael S. Tsirkin <mst@redhat.com>2022-12-21 06:35:28 -0500
commitc98ac64cfb53ccb862a80e818c3a19bdd386e61e (patch)
tree5e2fa64cecf8475b9842190529caa8456c8c7e8c
parentc1a1008685af0327d9d03f03d43bdb77e7af5bea (diff)
downloadqemu-c98ac64cfb53ccb862a80e818c3a19bdd386e61e.zip
qemu-c98ac64cfb53ccb862a80e818c3a19bdd386e61e.tar.gz
qemu-c98ac64cfb53ccb862a80e818c3a19bdd386e61e.tar.bz2
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. Signed-off-by: Yajun Wu <yajunw@nvidia.com> Acked-by: Parav Pandit <parav@nvidia.com> Message-Id: <20221122051447.248462-1-yajunw@nvidia.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--hw/virtio/vhost-user.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index b8aaa99..d9ce050 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -527,6 +527,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;
}