History | View | Annotate | Download (23.1 kB)
tap: fix NULL dereference when passing invalid parameters to tap
This patch forbid the following invalid parameters to tap:
1) fd and vhostfds were specified but vhostfd were not specified2) vhostfds were specified but fds were not specified3) fds and vhostfd were specified...
tap: properly initialize vhostfds
Only tap->vhostfd were checked net_init_tap_one(), but tap->vhostfds wereforgot, this will lead qemu to ignore all fds passed by management throughvhostfds, and tries to create vhost_net device itself. Fix by adding this check...
hw: move headers to include/
Many of these should be cleaned up with proper qdev-/QOM-ification.Right now there are many catch-all headers in include/hw/ARCH dependingon cpu.h, and this makes it necessary to compile these files per-target.However, fixing this does not belong in these patches....
net: increase buffer size to accommodate Jumbo frame pkts
Socket buffer sizes were hard-coded to 4K for VDE and socket netdevs. Bump thisup to 68K (ala tap netdev) to handle maximum GSO packet size (64k) plus plentyof room for the ethernet and virtio_net headers....
Fix typos and misspellings
Fix various typos and misspellings. The bulk of these were found withcodespell.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
tap: forbid creating multiqueue tap when hub is used
Obviously, hub does not support multiqueue tap. So this patch forbids creatingmultiple queue tap when hub is used to prevent the crash when command line suchas "-net tap,queues=2" is used.
Cc: qemu-stable@nongnu.org...
tap: unbreak -netdev tap,fd=X
The multiqueue patch series broke -netdev tap,fd=X which manifestsas libvirt not being able to start a guest. This was because itpassed NULL for the netdev name which results in an anonymous netdevdevice regardless of what the user specified....
tap: support enabling or disabling a queue
This patch introduce a new bit - enabled in TAPState which tracks whether aspecific queue/fd is enabled. The tap/fd is enabled during initialization andcould be enabled/disabled by tap_enalbe() and tap_disable() which calls platform...
tap: multiqueue support
Recently, linux support multiqueue tap which could let userspace call TUNSETIFFfor a signle device many times to create multiple file descriptors asindependent queues. User could also enable/disabe a specific queue throughTUNSETQUEUE....
tap: factor out common tap initialization
This patch factors out the common initialization of tap into a new helpernet_init_tap_one(). This will be used by multiqueue tap patches.
Signed-off-by: Jason Wang <jasowang@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
net: tap: using bool instead of bitfield
softmmu: move include files to include/sysemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
misc: move include files to include/qemu/
monitor: move include files to include/monitor/
net: reorganize headers
Move public headers to include/net, and leave private headers in net/.Put the virtio headers in include/net/tap.h, removing the multiple copiesthat existed. Leave include/net/tap.h as the interface for NICs, andnet/tap_int.h as the interface for OS-specific parts of the tap backend....
janitor: do not include qemu-char everywhere
Touching char/char.h basically causes the whole of QEMU tobe rebuilt. Avoid this, it is usually unnecessary.
tap: reset vnet header size on open
For tap, we currently assume the vnet header size is 10(the default value) but that might not be the caseif tap is persistent and has been used by qemu previously.To fix, set host header size in tap device on open....
net: consolidate NetClientState header files into one
This patch doesn't seem much useful alone, I must admit. However,it makes sense as part of the upcoming directory reorganization,where I want to have include/net/tap.h as the net<->hw interfacefor tap. Then having both net/tap.h and include/net/tap.h does...
monitor: Rename+move net_handle_fd_param -> monitor_handle_fd_param
This patch renames+moves the net_handle_fd_param() caller used toobtain a file descriptor from either qemu_parse_fd() (the normal case)or from monitor_get_fd() (migration case) into a generically prefixed...
net: Rename VLANClientState to NetClientState
The vlan feature is no longer part of net core. Rename VLANClientStateto NetClientState because net clients are not explicitly associated witha vlan at all, instead they have a peer net client to which they are...
net: Use hubs for the vlan feature
Stop using the special-case vlan code in net.c. Instead use the hub netclient to implement the vlan feature. The next patch will remove vlancode from net.c completely.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
net: Drop vlan argument to qemu_new_net_client()
Since hubs are now used to implement the 'vlan' feature and the vlanargument is always NULL, remove the argument entirely and update all netclients that use qemu_new_net_client().
hw, net: "net_client_type" -> "NetClientOptionsKind" (qapi-generated)
NET_CLIENT_TYPE_ -> NET_CLIENT_OPTIONS_KIND_
Signed-off-by: Laszlo Ersek <lersek@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
convert net_client_init() to OptsVisitor
The net_client_init() prototype is kept intact.
Based on "is_netdev", the QemuOpts-rooted QemuOpt-list is parsed as aNetdev or a NetLegacy. The original meat of net_client_init() is moved toand simplified in net_client_init1():...
convert net_init_tap() to NetClientOptions
convert net_init_bridge() to NetClientOptions
remove unused QemuOpts parameter from net init functions
v1->v2:- unchanged
v2->v3:- keep "qemu-option.h" included in "net/slirp.h"
qmp: include monitor.h when needed
This is needed to get file descriptors from SCM_RIGHTS.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
net: purge the monitor object from all init functions
The only backend that really uses it is the socket one, which callsmonitor_get_fd(). But it can use 'cur_mon' instead.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Reviewed-By: Laszlo Ersek <lersek@redhat.com>
Add support for net bridge
The most common use of -net tap is to connect a tap device to a bridge. Thisrequires the use of a script and running qemu as root in order to allocate atap device to pass to the script.
This model is great for portability and flexibility but it's incredibly...
network scripts: don't block SIGCHLD before forking
This patch fixes a bug where child processes of launch_script() canmisbehave due to SIGCHLD being blocked. In the case of `sudo`, thiscauses a permanent hang.
Previously a SIGCHLD handler was added to reap fork_exec()'d zombie...
Fix compilation warning due to missing header for sigaction (followup)
This patch removes all references to signal.h when qemu-common.h is includedas they become redundant.
Signed-off-by: Alexandre Raymond <cerbere@gmail.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
vhost: force vhost off for non-MSI guests
When MSI is off, each interrupt needs to be bounced through the iothread when it's set/cleared, so vhost-net causes more context switches andhigher CPU utilization than userspace virtio which handles networking in...
tap: clear vhost_net backend on cleanup
Frontends calling tap_get_vhost_net get an invalid pointer after thepeer backend has been deleted. Jason Wang <jasowang@redhat.com> reportsthis leading to a crash in ack_features when we remove the vhost-netbakend of a virtio nic....
tap: make set_offload a nop after netdev cleanup
virtio-net expects set_offload to succeed afterpeer 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>...
tap: add APIs for vnet header length
Add APIs to control host header length. First userwill be vhost-net.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
tap: generalize code for different vnet header len
Make host vnet header length a structure field inpreparation for using this support in linux kernel.
Remove dead assignments in various common files, spotted by clang analyzer
Value stored is never read.
Signed-off-by: Blue Swirl <blauwirbel@gmail.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
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
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...
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>...
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: remove VLANClientState members now in NetClientInfo
Add a NetClientInfo pointer to VLANClientState and use thatfor the typecode and function pointers.
net: convert tap to NetClientInfo
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: 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...
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 tap compilation on OS X
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: 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