Fix a warning on OpenSolaris
Add a missing #include statement to avoid a warning:/src/qemu/net/tap-solaris.c: In function 'tap_open':/src/qemu/net/tap-solaris.c:189: warning: implicit declaration of function 'error_report'
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
give some useful error messages when tap open
In net/tap-linux.c, when manipulation of /dev/net/tun fails, it prints(with fprintf) something like this:
warning: could not open /dev/net/tun: no virtual network emulation
this has 2 issues: 1) it is not a warning really, it's a fatal error (kvm exits after...
Remove dead assignments in various common files, spotted by clang analyzer
Value stored is never read.
Fix build on mingw32
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
tap: add interface to get device fd
Will be used by vhost to attach/detach to backend.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
tap: add vhost/vhostfd options
This adds vhost binary option to tap, to enable vhost net accelerator.Default is off for now, we'll be able to make default on long termwhen we know it's stable.
vhostfd option can be used by management, to pass in the fd. Assigning...
tap: add API to retrieve vhost net header
will be used by virtio-net for vhost net support
Fix BSD and win32 builds
CC net/tap-bsd.o/src/qemu/net/tap-bsd.c: In function `tap_open':/src/qemu/net/tap-bsd.c:93: warning: implicit declaration of function `error_report'
CC sparc-softmmu/../net/tap-win32.occ1: warnings being treated as errors...
Revert "tap: invoke downscript when we exit abnormally"
This reverts commit 8af8ce4d6116e3d46ad298ca8fe50d3b515b1aac.
tap: invoke downscript when we exit abnormally
Right now, downscript is not invoked reliably. If you execute 'quit' from themonitor, it won't be invoked.
This fixes that by converting tap to use an exit_notifier to execute thedownscript. In this case, allowing an exit notifier to include state is...
error: Replace qemu_error() by error_report()
error_report() terminates the message with a newline. Strip it itfrom its arguments.
This fixes a few error messages lacking a newline:net_handle_fd_param()'s "No file descriptor named %s found", andtap_open()'s "vnet_hdr=1 requested, but no kernel support for...
error: Move qemu_error & friends into their own header
slirp: check system() success
we shouldn't call W*() macros until we check that fork worked.
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
net: Fix bogus "Warning: vlan 0 with no nics" with -device
net_check_clients() prints this when an VLAN has host devices, but noguest devices. It uses VLANState members nb_guest_devs andnb_host_devs to keep track of these devices. However, -device does...
Fix BSD build
<sys/wait.h> must be included in order to use WIF* macros.
net/slirp.c: fix warning with _FORTIFY_SOURCE
CC net/slirp.occ1: warnings being treated as errorsnet/slirp.c: In function 'slirp_smb_cleanup':net/slirp.c:470: error: ignoring return value of 'system', declared with attribute warn_unused_resultmake: *** [net/slirp.o] Error 1...
net: add API to disable/enable polling
When vhost is bound to a backend device, we need to stop polling it whenvhost is started, and restart polling when vhost is stopped.Add an API for that for use by vhost, and implement in tap backend.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
tap: Compilation fix for Solaris
Avoid an unresolved symbol error for TFR,which is defined in sysemu.h.
Based on patch by Palle Lyckegaard.
Signed-off-by: Andreas Färber <afaerber@opensolaris.org>Cc: Palle Lyckegaard <palle@lyckegaard.dk>Cc: Ben Taylor <bentaylor.solx86@gmail.com>...
win32: fix variable use before initialization
Don't leak file descriptors
We're leaking file descriptors to child processes. Set FD_CLOEXEC on filedescriptors that don't need to be passed to children to stop this misbehaviour.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
net: fix TAP networking on host kernels without IFF_VNET_HDR support
vnet_hdr is initialized at 1 by default. We need to reset it to 0 ifthe kernel doesn't support IFF_VNET_HDR.
Signed-off-by: Pierre Riteau <Pierre.Riteau@irisa.fr>Signed-off-by: Mark McLoughlin <markmc@redhat.com>...
net: check for TUNSETOFFLOAD support before trying to enable offload features
This avoids the "TUNSETOFFLOAD ioctl() failed: Invalid argument" messageon kernels without TUNSETOFFLOAD support.
net: initialize vnet_hdr in net_init_tap()
net_tap_init() always sets vnet_hdr using qemu_opt_get_bool(), butinitialize it in net_init_tap() just to reduce confusion.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
net: fix vnet_hdr handling in solaris tap code
Print an error if the user specifies vnet_hdr=1 on the cmdline.
net: move parse_macaddr() to net/util.[ch]
net: remove VLANClientState members now in NetClientInfo
Add a NetClientInfo pointer to VLANClientState and use thatfor the typecode and function pointers.
net: convert slirp to NetClientInfo
net: convert vde to NetClientInfo
net: convert socket to NetClientInfo
net: convert dump to NetClientInfo
aliguori: fix uninitialized use of pcap_len
net: convert tap to NetClientInfo
net: convert tap-win32 to NetClientInfo
net: move vde code from net.c to net/vde.c
net: move socket backend code from net.c to net/socket.c
net: move dump backend code from net.c to net/dump.c
net: move slirp code from net.c to net/slirp.c
Add support for GNU/kFreeBSD
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Avoid segfault on net_tap_init() failure
Check for fd == -1 there.
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
tap-bsd: handle ifname on FreeBSD hosts
Handle ifname on FreeBSD hosts; if no ifname is given, always startthe search from tap0. (Simplified/cleaned up version of what has beenin the FreeBSD ports for a long time.)
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>...
Fix tap breakage on BSD hosts (no IFF_VNET_HDR)
net/tap-bsd.c was assuming IFF_VNET_HDR was always available, whichI think isn't true on any BSD.
tap: disable draining queue in one go
If qemu_send_packet_async() returns zero, it means the packet has beenqueued and the sent callback will be invoked once it has been flushed.
This is only possible where the NIC's receive() handler returns zeroand promises to notify the networking core that room is available in its...
net/queue: queue packets even if sender doesn't supply a callback
Now that we disable any receiver whose queue is full, we do not requiresenders to handle a zero return by supplying a sent callback.
This is a second step towards allowing can_receive() handlers to return...
tap: drain queue in tap_send()
Okay, let's try re-enabling the drain-entire-queue behaviour, with adifference - before each subsequent packet, use qemu_can_send_packet()to check that we can send it. This is similar to how we check beforepolling the tap fd and avoids having to drop a packet if the receiver...
Unbreak Linux build
commit 71f4effce79ec0485586963ea764f2c212c72f26 Author: Alexander Graf <agraf@suse.de> Date: Fri Oct 30 22:27:00 2009 +0100
Unbreak tap compilation on OS X
Broke the build on Linux due to a bad #if guard
Currently compiling the tap sources breaks on Mac OS X. This is because of:
1) tap-linux.h requiring Linux includes 2) typos 3) missing #includes
This patch adds what's necessary to compile tap happily on Mac OS X....
net: move UFO support detection to tap-linux.c
Only supported on Linux
net: move AIX code into net/tap-aix.c
Okay, this makes the tap options available on AIX even though there'sno support, but if we want to do it right we should have not compilethe tap code at all on AIX using e.g. CONFIG_TAP.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>...
net: move linux code into net/tap-linux.c
net: move tap_set_sndbuf() to tap-linux.c
TUNSETSNDBUF is only available on linux
net: move tap_probe_vnet_hdr() to tap-linux.c
Only Linux has support for IFF_VNET_HDR
net: move tap_set_offload() code into tap-linux.c
TUNSETOFFLOAD is only available on Linux
net: move tap-win32.c under net/
net: move more stuff into net/tap-win32.c, add net/tap.h
net: move tap-linux.h under net/
net: split all the tap code out into net/tap.c
net: split BSD tap_open() out into net/tap-bsd.c
net: move solaris code to net/tap-solaris.c
net: move net-queue.[ch] under net/
[v2: handle building in a separate dir]
net: move net-checksum.c under net/
Also add a new net/checksum.h header