]> git.ipfire.org Git - thirdparty/qemu.git/commit
tap: set vhostfd passed from qemu cli to non-blocking
authorBrijesh Singh <brijesh.singh@amd.com>
Fri, 6 Apr 2018 18:51:25 +0000 (13:51 -0500)
committerJason Wang <jasowang@redhat.com>
Fri, 15 Jun 2018 02:39:53 +0000 (10:39 +0800)
commitd542800d1edc62f63f8a29cfa6bdd1a9536ae11c
treed77cc3daa8b3899bcf2aac17576d459eb7df231a
parent409c241f887a38bb7a2ac12e34d3a8d73922a9a5
tap: set vhostfd passed from qemu cli to non-blocking

A guest boot hangs while probing the network interface when
iommu_platform=on is used.

The following qemu cli hangs without this patch:

# $QEMU \
  -netdev tap,fd=3,id=hostnet0,vhost=on,vhostfd=4 3<>/dev/tap67 4<>/dev/host-net \
  -device virtio-net-pci,netdev=hostnet0,id=net0,iommu_platform=on,disable-legacy=on \
  ...

Commit: c471ad0e9bd46 (vhost_net: device IOTLB support) took care of
setting vhostfd to non-blocking when QEMU opens /dev/host-net but if
the fd is passed from qemu cli then we need to ensure that fd is set
to non-blocking.

Fixes: c471ad0e9bd46 ("vhost_net: device IOTLB support")
Cc: qemu-stable@nongnu.org
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
net/tap.c