From df3485a14821edf75b1d3ee6ca38cd80fa989dbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 27 Jul 2016 01:15:09 +0400 Subject: [PATCH] vhost-user: call set_msgfds unconditionally MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is fine to call set_msgfds() with 0 fd, and ensures any previous fd array is cleared. Signed-off-by: Marc-André Lureau Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/vhost-user.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 495e09fd4e..f01b92f512 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -187,9 +187,7 @@ static int vhost_user_write(struct vhost_dev *dev, VhostUserMsg *msg, return 0; } - if (fd_num) { - qemu_chr_fe_set_msgfds(chr, fds, fd_num); - } + qemu_chr_fe_set_msgfds(chr, fds, fd_num); return qemu_chr_fe_write_all(chr, (const uint8_t *) msg, size) == size ? 0 : -1; -- GitLab