Stefano Garzarella 384c2561bd vhost-vsock: set vhostfd to non-blocking mode
vhost IOTLB API uses read()/write() to exchange iotlb messages with
the kernel module.
The QEMU implementation expects a non-blocking fd, indeed commit
c471ad0e9b ("vhost_net: device IOTLB support") set it for vhost-net.

Without this patch, if we enable iommu for the vhost-vsock device,
QEMU can hang when exchanging IOTLB messages.

As commit 894022e616 ("net: check if the file descriptor is valid
before using it") did for tap, let's use qemu_try_set_nonblock()
when fd is provided by the user.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20201029144849.70958-1-sgarzare@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2020-10-30 04:29:13 -04:00
..
2020-10-21 11:36:19 +02:00
2020-08-21 06:30:32 -04:00
2020-10-29 11:40:04 +00:00
2020-09-09 09:27:09 -04:00
2020-10-27 11:10:44 +00:00
2020-10-09 17:27:55 +01:00
2020-10-29 11:40:04 +00:00
2020-08-21 06:30:25 -04:00
2020-08-21 06:30:33 -04:00
2020-08-27 14:04:55 -04:00
2020-09-09 09:27:09 -04:00
2020-08-21 06:30:25 -04:00
2020-10-29 11:40:04 +00:00
2020-08-21 06:30:33 -04:00
2020-08-21 06:30:33 -04:00
2020-08-21 06:30:33 -04:00
2020-08-21 06:30:33 -04:00