qemu/include/net
Jay Zhou 46d4d36d0b tap: setting error appropriately when calling net_init_tap_one()
If netdev_add tap,id=net0,...,vhost=on failed in net_init_tap_one(),
the followed up device_add virtio-net-pci,netdev=net0 will fail
too, prints:

   TUNSETOFFLOAD ioctl() failed: Bad file descriptor TUNSETOFFLOAD
   ioctl() failed: Bad file descriptor

The reason is that the fd of tap is closed when error occured after
calling net_init_tap_one().

The fd should be closed when calling net_init_tap_one failed:
   - if tap_set_sndbuf() failed
   - if tap_set_sndbuf() succeeded but vhost failed to open or
     initialize with vhostforce flag on
   - with wrong vhost command line parameter
The fd should not be closed just because vhost failed to open or
initialize but without vhostforce flag. So the followed up
device_add can fall back to userspace virtio successfully.

Suggested-by: Michael S. Tsirkin <mst@redhat.com>
Suggested-by: Igor Mammedov <imammedo@redhat.com>
Suggested-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2018-03-05 10:30:16 +08:00
..
can_emu.h net/can: simple messages transport implementation for QEMU 2018-02-13 11:44:13 +01:00
can_host.h net/can: simple messages transport implementation for QEMU 2018-02-13 11:44:13 +01:00
checksum.h net: Transmit zero UDP checksum as 0xFFFF 2017-11-20 11:08:00 +08:00
eth.h slirp: add a fake NC-SI backend 2017-04-25 19:17:25 +08:00
filter.h Use scripts/clean-includes to drop redundant qemu/typedefs.h 2016-03-22 22:20:16 +01:00
net.h net: Make net_client_init() static 2018-03-05 10:30:15 +08:00
queue.h net/queue: export qemu_net_queue_append_iov 2015-10-12 13:31:18 +08:00
slirp.h Move include qemu/option.h from qemu-common.h to actual users 2018-02-09 13:52:16 +01:00
tap.h Drop superfluous includes of qapi-types.h and test-qapi-types.h 2018-02-09 05:05:11 +01:00
vhost-user.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
vhost_net.h tap: setting error appropriately when calling net_init_tap_one() 2018-03-05 10:30:16 +08:00