summaryrefslogtreecommitdiffstats
path: root/net
Commit message (Collapse)AuthorAgeFilesLines
* Use qemu-common.h or qemu-timer.h in place of sysemu.hBlue Swirl2011-04-151-1/+1
| | | | | | | In some cases qemu-common.h or qemu-timer.h can be used in place of sysemu.h. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Remove unused sysemu.h include directivesBlue Swirl2011-04-152-2/+0
| | | | | | | Remove unused sysemu.h include directives to speed up build with the following patches. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* change all other clock references to use nanosecond resolution accessorsPaolo Bonzini2011-03-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | This was done with: sed -i 's/qemu_get_clock\>/qemu_get_clock_ns/' \ $(git grep -l 'qemu_get_clock\>' ) sed -i 's/qemu_new_timer\>/qemu_new_timer_ns/' \ $(git grep -l 'qemu_new_timer\>' ) after checking that get_clock and new_timer never occur twice on the same line. There were no missed occurrences; however, even if there had been, they would have been caught by the compiler. There was exactly one false positive in qemu_run_timers: - current_time = qemu_get_clock (clock); + current_time = qemu_get_clock_ns (clock); which is of course not in this patch. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* Fixing tap adapter for win32Pavel Dovgaluk2011-02-251-1/+1
| | | | | | | | | This fix allows connection of internal VLAN to the external TAP interface. If tap_win32_write function always returns 0, the TAP network interface in QEMU is disabled. Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fixing network over sockets implementation for win32Pavel Dovgaluk2011-02-251-1/+1
| | | | | | | | | | | MSDN includes the following in WSAEALREADY error description for connect() function: "To preserve backward compatibility, this error is reported as WSAEINVAL to Winsock applications that link to either Winsock.dll or Wsock32.dll". So check of this error code was added to allow network connections through the sockets in Windows. Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* vhost: force vhost off for non-MSI guestsmst@redhat.com2011-02-011-2/+4
| | | | | | | | | | | | | | | When MSI is off, each interrupt needs to be bounced through the io thread when it's set/cleared, so vhost-net causes more context switches and higher CPU utilization than userspace virtio which handles networking in the same thread. We'll need to fix this by adding level irq support in kvm irqfd, for now disable vhost-net in these configurations. Added a vhostforce flag to force vhost-net back on. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* tap: safe sndbuf defaultMichael S. Tsirkin2011-02-011-4/+9
| | | | | | | | | | | | With current sndbuf default value, a blocked target guest can prevent another guest from transmitting any packets. While current sndbuf value (1M) is reported to help some UDP based workloads, the default should be safe (0). Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add support for OpenBSD to QEMU's tap driver.Brad2010-12-211-2/+6
| | | | | Signed-off-by: Brad Smith <brad@comstyle.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix warning on mingw32Blue Swirl2010-12-171-1/+2
| | | | | | | | Avoid this warning like other uses of setsockopt: /src/qemu/net/socket.c: In function 'net_socket_mcast_create': /src/qemu/net/socket.c:210: warning: passing argument 4 of 'setsockopt' from incompatible pointer type Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* net/sock: option to specify local addressMike Ryan2010-12-091-13/+39
| | | | | | | | | | | | | Add an option to specify the host IP to send multicast packets from, when using a multicast socket for networking. The option takes an IP address and sets the IP_MULTICAST_IF socket option, which causes the packets to use that IP's interface as an egress. This is useful if the host machine has several interfaces with several virtual networks across disparate interfaces. Signed-off-by: Mike Ryan <mikeryan@ISI.EDU> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* tap: make set_offload a nop after netdev cleanupMichael S. Tsirkin2010-11-161-1/+5
| | | | | | | | | | virtio-net expects set_offload to succeed after peer cleanup. Since we don't have an open fd anymore, make it so. Fixes warning about the failure of offload setting. Reported-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* tap: clear vhost_net backend on cleanupMichael S. Tsirkin2010-11-161-0/+1
| | | | | | | | | | | Frontends calling tap_get_vhost_net get an invalid pointer after the peer backend has been deleted. Jason Wang <jasowang@redhat.com> reports this leading to a crash in ack_features when we remove the vhost-net bakend of a virtio nic. The fix is simply to clear the backend pointer. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* Delete write only variablesBlue Swirl2010-10-131-3/+2
| | | | | | | | | | Compiling with GCC 4.6.0 20100925 produced warnings like: /src/qemu/net/tap-win32.c: In function 'tap_win32_open': /src/qemu/net/tap-win32.c:582:12: error: variable 'hThread' set but not used [-Werror=unused-but-set-variable] Fix by removing the unused variables. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* tap: Add stub for HaikuAndreas Färber2010-10-031-0/+61
| | | | | | | Adapted from AIX code. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* tap: Remove double include of util.hAndreas Färber2010-09-291-4/+0
| | | | | | | | | | If neither of __FreeBSD__, __FreeBSD_kernel__ and __DragonFly__ is defined, util.h is included from tap-bsd.c. Don't include it again if __OpenBSD__ is defined. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* tap: add APIs for vnet header lengthMichael S. Tsirkin2010-09-078-0/+92
| | | | | | | Add APIs to control host header length. First user will be vhost-net. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* tap: generalize code for different vnet header lenMichael S. Tsirkin2010-09-072-14/+20
| | | | | | | Make host vnet header length a structure field in preparation for using this support in linux kernel. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* Fix a warning on OpenSolarisBlue Swirl2010-07-311-0/+1
| | | | | | | | 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 openMichael Tokarev2010-06-221-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 that), 2) there's no indication as of what's actually wrong: printing errno there is helpful. The patch below removes the "warning" prefix, uses %m (since it's linux, %m is available as format modifier), and changes fprintf() to %qemu_error(). Now it prints something like this instead: could not configure /dev/net/tun: Device or resource busy (there are 2 messages like that in the same function) This fixes Debian bug #578154, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578154 Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Remove dead assignments in various common files, spotted by clang analyzerBlue Swirl2010-04-251-1/+1
| | | | | | Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix build on mingw32Anthony Liguori2010-04-021-0/+5
| | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* tap: add API to retrieve vhost net headerMichael S. Tsirkin2010-04-012-0/+10
| | | | | | | will be used by virtio-net for vhost net support Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* tap: add vhost/vhostfd optionsMichael S. Tsirkin2010-04-011-0/+29
| | | | | | | | | | | | 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 term when we know it's stable. vhostfd option can be used by management, to pass in the fd. Assigning vhostfd implies vhost=on. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* tap: add interface to get device fdMichael S. Tsirkin2010-04-012-0/+9
| | | | | | | 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>
* Fix BSD and win32 buildsBlue Swirl2010-03-272-0/+2
| | | | | | | | | | | | | 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.o cc1: warnings being treated as errors /src/qemu/target-sparc/../net/tap-win32.c: In function 'net_init_tap': /src/qemu/target-sparc/../net/tap-win32.c:709: warning: implicit declaration of function 'error_report' Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Revert "tap: invoke downscript when we exit abnormally"Anthony Liguori2010-03-211-16/+0
| | | | This reverts commit 8af8ce4d6116e3d46ad298ca8fe50d3b515b1aac.
* tap: invoke downscript when we exit abnormallyAnthony Liguori2010-03-191-0/+16
| | | | | | | | | | | Right now, downscript is not invoked reliably. If you execute 'quit' from the monitor, it won't be invoked. This fixes that by converting tap to use an exit_notifier to execute the downscript. In this case, allowing an exit notifier to include state is critically important for the conversion. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* error: Replace qemu_error() by error_report()Markus Armbruster2010-03-168-32/+33
| | | | | | | | | | | | | error_report() terminates the message with a newline. Strip it it from its arguments. This fixes a few error messages lacking a newline: net_handle_fd_param()'s "No file descriptor named %s found", and tap_open()'s "vnet_hdr=1 requested, but no kernel support for IFF_VNET_HDR available" (all three versions). There's one place that passes arguments without newlines intentionally: load_vmstate(). Fix it up.
* error: Move qemu_error & friends into their own headerMarkus Armbruster2010-03-164-1/+4
|
* slirp: check system() successJuan Quintela2010-03-091-1/+1
| | | | | | | 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 -deviceMarkus Armbruster2010-02-195-20/+0
| | | | | | | | | | | | net_check_clients() prints this when an VLAN has host devices, but no guest devices. It uses VLANState members nb_guest_devs and nb_host_devs to keep track of these devices. However, -device does not update nb_guest_devs, only net_init_nic() does that, for -net nic. Check the VLAN clients directly, and remove the counters. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix BSD buildBlue Swirl2010-01-271-0/+3
| | | | | | <sys/wait.h> must be included in order to use WIF* macros. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* net/slirp.c: fix warning with _FORTIFY_SOURCEKirill A. Shutemov2010-01-261-1/+8
| | | | | | | | | | | | CC net/slirp.o cc1: warnings being treated as errors net/slirp.c: In function 'slirp_smb_cleanup': net/slirp.c:470: error: ignoring return value of 'system', declared with attribute warn_unused_result make: *** [net/slirp.o] Error 1 Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: add API to disable/enable pollingMichael S. Tsirkin2010-01-081-0/+8
| | | | | | | | | When vhost is bound to a backend device, we need to stop polling it when vhost 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> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* tap: Compilation fix for SolarisAndreas Färber2009-12-131-0/+1
| | | | | | | | | | | | 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> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* win32: fix variable use before initializationBlue Swirl2009-12-041-2/+2
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Don't leak file descriptorsKevin Wolf2009-12-031-4/+4
| | | | | | | | We're leaking file descriptors to child processes. Set FD_CLOEXEC on file descriptors 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 vnet_hdr handling in solaris tap codeMark McLoughlin2009-12-031-0/+11
| | | | | | | Print an error if the user specifies vnet_hdr=1 on the cmdline. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: initialize vnet_hdr in net_init_tap()Mark McLoughlin2009-12-031-1/+1
| | | | | | | | net_tap_init() always sets vnet_hdr using qemu_opt_get_bool(), but initialize 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: check for TUNSETOFFLOAD support before trying to enable offload featuresPierre Riteau2009-12-031-0/+5
| | | | | | | | | This avoids the "TUNSETOFFLOAD ioctl() failed: Invalid argument" message on kernels without TUNSETOFFLOAD support. Signed-off-by: Pierre Riteau <Pierre.Riteau@irisa.fr> Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: fix TAP networking on host kernels without IFF_VNET_HDR supportPierre Riteau2009-12-031-0/+2
| | | | | | | | | vnet_hdr is initialized at 1 by default. We need to reset it to 0 if the kernel doesn't support IFF_VNET_HDR. Signed-off-by: Pierre Riteau <Pierre.Riteau@irisa.fr> Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: remove VLANClientState members now in NetClientInfoMark McLoughlin2009-12-031-3/+3
| | | | | | | | Add a NetClientInfo pointer to VLANClientState and use that for the typecode and function pointers. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: move parse_macaddr() to net/util.[ch]Mark McLoughlin2009-12-032-0/+92
| | | | | Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: convert dump to NetClientInfoMark McLoughlin2009-12-031-21/+28
| | | | | | | aliguori: fix uninitialized use of pcap_len Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: convert socket to NetClientInfoMark McLoughlin2009-12-031-29/+45
| | | | | Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: convert vde to NetClientInfoMark McLoughlin2009-12-031-17/+28
| | | | | Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: convert slirp to NetClientInfoMark McLoughlin2009-12-031-24/+37
| | | | | Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: convert tap-win32 to NetClientInfoMark McLoughlin2009-12-031-16/+23
| | | | | Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: convert tap to NetClientInfoMark McLoughlin2009-12-031-37/+45
| | | | | Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: move dump backend code from net.c to net/dump.cMark McLoughlin2009-12-032-0/+184
| | | | | Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
OpenPOWER on IntegriCloud