From: Yajun Wu Date: Tue, 22 Nov 2022 05:14:47 +0000 (+0800) Subject: vhost-user: send set log base message only once X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=c98ac64cfb53ccb862a80e818c3a19bdd386e61e;p=people%2Fpauldu%2Fqemu.git 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 Acked-by: Parav Pandit Message-Id: <20221122051447.248462-1-yajunw@nvidia.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index b8aaa99ab5..d9ce0501b2 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; }