qemu-e2k/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 net/can: support for connecting to Linux host SocketCAN interface. 2018-02-13 11:44:13 +01:00
checksum.c
clients.h Drop superfluous includes of qapi-types.h and test-qapi-types.h 2018-02-09 05:05:11 +01:00
colo-compare.c Drop superfluous includes of qapi/qmp/qerror.h 2018-02-09 13:51:35 +01:00
colo.c colo: compare the packet based on the tcp sequence number 2018-01-29 16:05:37 +08:00
colo.h colo: compare the packet based on the tcp sequence number 2018-01-29 16:05:37 +08:00
dump.c net: Remove the deprecated way of dumping network packets 2018-03-05 10:30:15 +08:00
eth.c net/eth: fix incorrect check of iov_to_buf() return value 2017-07-31 13:06:38 +03:00
filter-buffer.c
filter-mirror.c Drop superfluous includes of qapi/qmp/qerror.h 2018-02-09 13:51:35 +01:00
filter-replay.c Include qapi/error.h exactly where needed 2018-02-09 13:50:17 +01:00
filter-rewriter.c Drop superfluous includes of qapi/qmp/qerror.h 2018-02-09 13:51:35 +01:00
filter.c qapi: Change data type of the FOO_lookup generated for enum FOO 2017-09-04 13:09:13 +02:00
hub.c net: Allow hubports to connect to other netdevs 2018-01-29 16:05:37 +08:00
hub.h net: Allow hubports to connect to other netdevs 2018-01-29 16:05:37 +08:00
l2tpv3.c
Makefile.objs net/can: simple messages transport implementation for QEMU 2018-02-13 11:44:13 +01:00
net.c net: Add a new convenience option "--nic" to configure default/on-board NICs 2018-03-05 10:30:16 +08:00
netmap.c
queue.c
slirp.c Include qapi/qmp/qdict.h exactly where needed 2018-02-09 13:52:15 +01:00
socket.c net/socket: fix coverity issue 2017-11-13 18:05:12 +08:00
tap_int.h Include qapi/qmp/qdict.h exactly where needed 2018-02-09 13:52:15 +01:00
tap-bsd.c
tap-linux.c
tap-linux.h
tap-solaris.c
tap-stub.c
tap-win32.c
tap.c tap: setting error appropriately when calling net_init_tap_one() 2018-03-05 10:30:16 +08:00
trace-events colo: compare the packet based on the tcp sequence number 2018-01-29 16:05:37 +08:00
util.c
util.h
vde.c
vhost-user.c vhost-user: fix memory leak 2018-03-01 16:05:26 +02:00