vhost-user: call set_msgfds unconditionally

It is fine to call set_msgfds() with 0 fd, and ensures any previous fd
array is cleared.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
master
Marc-André Lureau 2016-07-27 01:15:09 +04:00 committed by Michael S. Tsirkin
parent 5c7eaabf65
commit df3485a148
1 changed files with 1 additions and 3 deletions

View File

@ -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;