- May 11, 2022
-
-
Markus Armbruster authored
Cleaned up with scripts/clean-header-guards.pl. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20220506134911.2856099-5-armbru@redhat.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
- Sep 09, 2020
-
-
Eduardo Habkost authored
Generated using: $ ./scripts/codeconverter/converter.py -i \ --pattern=TypeCheckMacro $(git grep -l '' -- '*.[ch]') Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com> Reviewed-by:
Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-12-ehabkost@redhat.com> Reviewed-by:
Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-13-ehabkost@redhat.com> Message-Id: <20200831210740.126168-14-ehabkost@redhat.com> Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com>
-
Eduardo Habkost authored
Some typedefs and macros are defined after the type check macros. This makes it difficult to automatically replace their definitions with OBJECT_DECLARE_TYPE. Patch generated using: $ ./scripts/codeconverter/converter.py -i \ --pattern=QOMStructTypedefSplit $(git grep -l '' -- '*.[ch]') which will split "typdef struct { ... } TypedefName" declarations. Followed by: $ ./scripts/codeconverter/converter.py -i --pattern=MoveSymbols \ $(git grep -l '' -- '*.[ch]') which will: - move the typedefs and #defines above the type check macros - add missing #include "qom/object.h" lines if necessary Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com> Reviewed-by:
Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-9-ehabkost@redhat.com> Reviewed-by:
Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-10-ehabkost@redhat.com> Message-Id: <20200831210740.126168-11-ehabkost@redhat.com> Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com>
-
- Jul 13, 2020
-
-
Philippe Mathieu-Daudé authored
Split out code only used during system emulation, to reduce code pulled in user emulation and tools. Signed-off-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200423202112.644-6-philmd@redhat.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com>
-
Philippe Mathieu-Daudé authored
No file out of chardev/ requires access to this header, restrict its scope. Signed-off-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200423202112.644-5-philmd@redhat.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com>
-
- Jan 08, 2020
-
-
Paolo Bonzini authored
This uses the QEMUChrEvent enum everywhere except in IOEventHandler. The IOEventHandler change needs to happen at once for all front ends and is done with Coccinelle in the next patch. (Extracted from a patch by Philippe Mathieu-Daudé). Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Feb 13, 2019
-
-
Marc-André Lureau authored
Instead of handling mux chardev in a special way in qemu_chr_fe_set_handlers(), we may use the chr_update_read_handler class callback instead. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20190206174328.9736-2-marcandre.lureau@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Mar 12, 2018
-
-
Peter Xu authored
Introduce ChardevClass.chr_machine_done() hook so that chardevs can run customized procedures after machine init. There was an existing mux user already that did similar thing but used a raw machine done notifier. Generalize it into a framework, and let the mux chardevs provide such a class-specific hook to achieve the same thing. Then we can move the mux related code to the char-mux.c file. Since at it, replace the mux_realized variable with the global machine_init_done varible. This notifier framework will be further leverged by other type of chardevs soon. Signed-off-by:
Peter Xu <peterx@redhat.com> Message-Id: <20180306053320.15401-6-peterx@redhat.com> Acked-by:
Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jun 02, 2017
-
-
Marc-André Lureau authored
Move all the frontend struct and methods to a seperate unit. This avoids accidentally mixing backend and frontend calls, and helps with readabilty. Make qemu_chr_replay() a macro shared by both char and char-fe. Export qemu_chr_write(), and use a macro for qemu_chr_write_all() (nb: yes, CharBackend is for char frontend :) Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org>
-
Marc-André Lureau authored
So they are all in one place. The following patch will move serial & parallel declarations to the respective headers. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org>
-
- May 04, 2017
-
-
Marc-André Lureau authored
mux_chr_event() already send events to all backends, rename it, export it, and use it from muxes_realize_done. This should help abstract away mux implementation. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org>
-
- Jan 31, 2017
-
-
Marc-André Lureau authored
A mechanical move, except that qemu_chr_write_all() needs to be declared in char.h header to be used from chardev unit files. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com>
-
Marc-André Lureau authored
Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com>
-
- Feb 26, 2015
-
-
Michael S. Tsirkin authored
Drop duplicated code. Signed-off-by:
Michael S. Tsirkin <mst@redhat.com> Reviewed-by:
Thomas Huth <thuth@linux.vnet.ibm.com>
-
- Feb 25, 2014
-
-
Vincenzo Maffione authored
Since TAP offloadings are manipulated through a new API, it's not necessary to export them in include/net/tap.h anymore. Signed-off-by:
Vincenzo Maffione <v.maffione@gmail.com> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Vincenzo Maffione authored
The tap_has_vnet_hdr() and tap_has_vnet_hdr_len() functions used to return int, even though they only return true/false values. This patch changes the prototypes to return bool. Signed-off-by:
Vincenzo Maffione <v.maffione@gmail.com> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
- Feb 01, 2013
-
-
Jason Wang authored
Recently, linux support multiqueue tap which could let userspace call TUNSETIFF for a signle device many times to create multiple file descriptors as independent queues. User could also enable/disabe a specific queue through TUNSETQUEUE. The patch adds the generic infrastructure to create multiqueue taps. To achieve this a new parameter "queues" were introduced to specify how many queues were expected to be created for tap by qemu itself. Alternatively, management could also pass multiple pre-created tap file descriptors separated with ':' through a new parameter fds like -netdev tap,id=hn0,fds="X:Y:..:Z". Multiple vhost file descriptors could also be passed in this way. Each TAPState were still associated to a tap fd, which mean multiple TAPStates were created when user needs multiqueue taps. Since each TAPState contains one NetClientState, with the multiqueue nic support, an N peers of NetClientState were built up. A new parameter, mq_required were introduce in tap_open() to create multiqueue tap fds. Signed-off-by:
Jason Wang <jasowang@redhat.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
Jason Wang authored
This patch introduces a helper tap_get_ifname() to get the device name of tap device. This is needed when ifname is unspecified in the command line and qemu were asked to create tap device by itself. In this situation, the name were allocated by kernel, so if multiqueue is asked, we need to fetch its name after creating the first queue. Only linux has this support since it's the only platform that supports multiqueue tap. Signed-off-by:
Jason Wang <jasowang@redhat.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
Jason Wang authored
This patch introduce a new bit - enabled in TAPState which tracks whether a specific queue/fd is enabled. The tap/fd is enabled during initialization and could be enabled/disabled by tap_enalbe() and tap_disable() which calls platform specific helpers to do the real work. Polling of a tap fd can only done when the tap was enabled. Signed-off-by:
Jason Wang <jasowang@redhat.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
Jason Wang authored
Signed-off-by:
Jason Wang <jasowang@redhat.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
- Dec 19, 2012
-
-
Paolo Bonzini authored
Move public headers to include/net, and leave private headers in net/. Put the virtio headers in include/net/tap.h, removing the multiple copies that existed. Leave include/net/tap.h as the interface for NICs, and net/tap_int.h as the interface for OS-specific parts of the tap backend. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Oct 08, 2012
-
-
Paolo Bonzini authored
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 interface for tap. Then having both net/tap.h and include/net/tap.h does not work. "Fixed" by moving all the init functions to a single header file net/clients.h. The patch also adopts a uniform style for including net/*.h files from net/*.c, without the net/ path. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Stefan Hajnoczi <stefanha@gmail.com>
-
- Aug 01, 2012
-
-
Stefan Hajnoczi authored
Now that VLANClientState has been renamed to NetClientState all 'vc' local variables should be 'nc'. Much of the code already used 'nc' but there are places where 'vc' needs to be renamed. Signed-off-by:
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by:
Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Reviewed-by:
Laszlo Ersek <lersek@redhat.com>
-
Stefan Hajnoczi authored
The vlan feature is no longer part of net core. Rename VLANClientState to NetClientState because net clients are not explicitly associated with a vlan at all, instead they have a peer net client to which they are connected. This patch is a mechanical search-and-replace except for a few whitespace fixups where changing VLANClientState to NetClientState misaligned whitespace. Signed-off-by:
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by:
Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Reviewed-by:
Laszlo Ersek <lersek@redhat.com>
-
Stefan Hajnoczi authored
Stop using the special-case vlan code in net.c. Instead use the hub net client to implement the vlan feature. The next patch will remove vlan code from net.c completely. Signed-off-by:
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by:
Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Reviewed-by:
Laszlo Ersek <lersek@redhat.com>
-
- Jul 23, 2012
-
-
Laszlo Ersek authored
v1->v2: - unchanged v2->v3: - keep "qemu-option.h" included in "net/slirp.h" Signed-off-by:
Laszlo Ersek <lersek@redhat.com> Signed-off-by:
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
-
Laszlo Ersek authored
Signed-off-by:
Laszlo Ersek <lersek@redhat.com> Signed-off-by:
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
-
Laszlo Ersek authored
The net_client_init() prototype is kept intact. Based on "is_netdev", the QemuOpts-rooted QemuOpt-list is parsed as a Netdev or a NetLegacy. The original meat of net_client_init() is moved to and simplified in net_client_init1(): Fields not common between -net and -netdev are clearly separated. Getting the name for the init functions is cleaner: Netdev::id is mandatory, and all init functions handle a NULL NetLegacy::name. NetLegacy::vlan explicitly depends on -net (see below). Verifying the "type=" option for -netdev can be turned into a switch. Format validation with qemu_opts_validate() can be removed because the visitor covers it. Relatedly, the "net_client_types" array is reduced to an array of init functions that can be directly indexed by opts->kind. (Help text is available in the schema JSON.) The outermost negation in the condition around qemu_find_vlan() was flattened, because it expresses the dependent code's requirements more clearly. VLAN lookup is avoided if there's no init function to pass the VLAN to. Whenever the value of type=... is needed, we substitute NetClientOptionsKind_lookup[kind]. The individual init functions are not converted yet, thus the original QemuOpts instance is passed transparently. v1->v2: - NetLegacy::name is optional. Tracked it through all init functions: they all handle a NULL name. Updated commit message accordingly. v2->v3: - NetLegacy::id is allowed and takes precedence over NetLegacy::name. Signed-off-by:
Laszlo Ersek <lersek@redhat.com> Signed-off-by:
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
-
- Jun 04, 2012
-
-
Luiz Capitulino authored
The only backend that really uses it is the socket one, which calls monitor_get_fd(). But it can use 'cur_mon' instead. Signed-off-by:
Luiz Capitulino <lcapitulino@redhat.com> Reviewed-By:
Laszlo Ersek <lersek@redhat.com>
-
- Feb 01, 2012
-
-
Corey Bryant authored
The most common use of -net tap is to connect a tap device to a bridge. This requires the use of a script and running qemu as root in order to allocate a tap device to pass to the script. This model is great for portability and flexibility but it's incredibly difficult to eliminate the need to run qemu as root. The only really viable mechanism is to use tunctl to create a tap device, attach it to a bridge as root, and then hand that tap device to qemu. The problem with this mechanism is that it requires administrator intervention whenever a user wants to create a guest. By essentially writing a helper that implements the most common qemu-ifup script that can be safely given cap_net_admin, we can dramatically simplify things for non-privileged users. We still support existing -net tap options as a mechanism for advanced users and backwards compatibility. Currently, this is very Linux centric but there's really no reason why it couldn't be extended for other Unixes. A typical invocation would be similar to one of the following: qemu linux.img -net bridge -net nic,model=virtio qemu linux.img -net tap,helper="/usr/local/libexec/qemu-bridge-helper" -net nic,model=virtio qemu linux.img -netdev bridge,id=hn0 -device virtio-net-pci,netdev=hn0,id=nic1 qemu linux.img -netdev tap,helper="/usr/local/libexec/qemu-bridge-helper",id=hn0 -device virtio-net-pci,netdev=hn0,id=nic1 The default bridge that we attach to is br0. The thinking is that a distro could preconfigure such an interface to allow out-of-the-box bridged networking. Alternatively, if a user wants to use a different bridge, a typical invocation would be simliar to one of the following: qemu linux.img -net bridge,br=qemubr0 -net nic,model=virtio qemu linux.img -net tap,helper="/usr/local/libexec/qemu-bridge-helper --br=qemubr0" -net nic,model=virtio qemu linux.img -netdev bridge,br=qemubr0,id=hn0 -device virtio-net-pci,netdev=hn0,id=nic1 qemu linux.img -netdev tap,helper="/usr/local/libexec/qemu-bridge-helper --br=qemubr0",id=hn0 -device virtio-net-pci,netdev=hn0,id=nic1 Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com> Signed-off-by:
Richa Marwaha <rmarwah@linux.vnet.ibm.com> Signed-off-by:
Corey Bryant <coreyb@linux.vnet.ibm.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
- Sep 07, 2010
-
-
Michael S. Tsirkin authored
Add APIs to control host header length. First user will be vhost-net. Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
- Apr 01, 2010
-
-
Michael S. Tsirkin authored
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>
-
Michael S. Tsirkin authored
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>
-
- Oct 30, 2009
-
-
Mark McLoughlin authored
Only supported on Linux Signed-off-by:
Mark McLoughlin <markmc@redhat.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
Mark McLoughlin authored
TUNSETOFFLOAD is only available on Linux Signed-off-by:
Mark McLoughlin <markmc@redhat.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
Mark McLoughlin authored
Only Linux has support for IFF_VNET_HDR Signed-off-by:
Mark McLoughlin <markmc@redhat.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
Mark McLoughlin authored
TUNSETSNDBUF is only available on linux Signed-off-by:
Mark McLoughlin <markmc@redhat.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
Mark McLoughlin authored
Signed-off-by:
Mark McLoughlin <markmc@redhat.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
Mark McLoughlin authored
Signed-off-by:
Mark McLoughlin <markmc@redhat.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
Mark McLoughlin authored
Signed-off-by:
Mark McLoughlin <markmc@redhat.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-