From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39522) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSyHs-00060Q-MY for qemu-devel@nongnu.org; Thu, 28 Jul 2016 23:16:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSyHr-000312-NB for qemu-devel@nongnu.org; Thu, 28 Jul 2016 23:16:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35876) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSyHr-00030y-HQ for qemu-devel@nongnu.org; Thu, 28 Jul 2016 23:16:35 -0400 Date: Fri, 29 Jul 2016 06:16:32 +0300 From: "Michael S. Tsirkin" Message-ID: <1469762011-7902-26-git-send-email-mst@redhat.com> References: <1469762011-7902-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1469762011-7902-1-git-send-email-mst@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 25/41] vhost-user: call set_msgfds unconditionally List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , =?iso-8859-1?Q?Marc-Andr=E9?= Lureau From: Marc-Andr=E9 Lureau It is fine to call set_msgfds() with 0 fd, and ensures any previous fd array is cleared. Signed-off-by: Marc-Andr=E9 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 495e09f..f01b92f 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, Vh= ostUserMsg *msg, return 0; } =20 - if (fd_num) { - qemu_chr_fe_set_msgfds(chr, fds, fd_num); - } + qemu_chr_fe_set_msgfds(chr, fds, fd_num); =20 return qemu_chr_fe_write_all(chr, (const uint8_t *) msg, size) =3D=3D= size ? 0 : -1; --=20 MST