提交 df3485a1 编写于 作者: M Marc-André Lureau 提交者: Michael S. Tsirkin

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: NMarc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
上级 5c7eaabf
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册