summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Remove aio_ctx from paio_* interfaceKevin Wolf2009-10-303-14/+11
| | | | | | | | | | The context parameter in paio_submit isn't used anyway, so there is no reason why block drivers should need to remember it. This also avoids passing a Linux AIO context to paio_submit (which doesn't do any harm as long as the parameter is unused, but it is highly confusing). Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add *CFLAGS to LINK in rules.makPeter Hjalmarsson2009-10-301-1/+1
| | | | | | | | | Sometimes when linking with gcc to get a predictable result you are suggested to also apply the compiler flags to the linker command. For reference, please read: http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Link-Options.html Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* serial: Add missing bitStefan Weil2009-10-301-3/+5
| | | | | | | | Serial frames always start with a start bit. This bit was missing in frame size calculation. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* serial: Support additional serial speed valuesStefan Weil2009-10-301-26/+61
| | | | | | | | | * Allow any speed value which is defined for Linux (and possibly other systems). * Compare int values instead of double values. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* usb: print attached status in info qtreeGerd Hoffmann2009-10-301-3/+4
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* usb-host: use qdev for -usbdevice + rework.Gerd Hoffmann2009-10-301-266/+144
| | | | | | | | | | | | | | | Changes: * We don't create/delete devices, we attach/detach them instead. * The separate autofilter list is gone, we simply walk the list of devices directly instead. * Autofiltering is done unconditionally now. Non-auto device scan code got dropped. * Autofiltering turns off the timer if there is nothing to do, it runs only in case there are unattached host devices. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* usb-storage: use qdev for -usbdeviceGerd Hoffmann2009-10-303-37/+25
| | | | | | | | | | Hook up usb_msd_init. Also rework handling of encrypted block devices, move the code out vl.c. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* usb: make attach optional.Gerd Hoffmann2009-10-302-1/+3
| | | | | | | | | | | | | | Add a auto_attach field to USBDevice, which is enabled by default. USB drivers can clear this field in case they do *not* want the device being attached (i.e. plugged into a usb port) automatically after successfull init(). Use cases (see next patches): * attaching encrypted mass storage devices. * -usbdevice host:... Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* usb-serial and braille: use qdev for -usbdeviceGerd Hoffmann2009-10-305-38/+65
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* usb-hid: use qdev for -usbdeviceGerd Hoffmann2009-10-303-29/+4
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* usb core: use qdev for -usbdeviceGerd Hoffmann2009-10-305-1/+59
| | | | | | | | | | | | | | This patchs adds infrastructure to handle -usbdevice via qdev callbacks. USBDeviceInfo gets a name field (for the -usbdevice driver name) and a callback for -usbdevice parameter parsing. The new usbdevice_create() function walks the qdev driver list and looks for a usb driver with a matching name. When a parameter parsing callback is present it is called, otherwise the device is created via usb_create_simple(). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* use rom loader for pc bios.Gerd Hoffmann2009-10-301-2/+2
| | | | | | | | | | | The pc bios shows up in 'info roms' now. Note that the BIOS is mapped to two places: The complete rom at the top of the memory, and the first 128k at 0xe0000. Only the first place is listed in 'info roms'. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vga roms: move loading from pc.c to vga drivers.Gerd Hoffmann2009-10-305-13/+14
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* rom loader: make vga+rom loading configurable.Gerd Hoffmann2009-10-303-4/+19
| | | | | | | | | | | | | The rom_add_vga() and rom_add_option() macros are transformed into functions. They look at the new rom_enable_driver_roms variable and only do something if it is set to non-zero, making vga+option rom loading runtime option. pc_init() sets rom_enable_driver_roms to 1. With this in place we can move the rom loading calls from pc.c to the individual drivers. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* rom loader: use qemu_strdup.Gerd Hoffmann2009-10-301-1/+1
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: move UFO support detection to tap-linux.cMark McLoughlin2009-10-306-6/+29
| | | | | | | Only supported on Linux Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: move tap_set_offload() code into tap-linux.cMark McLoughlin2009-10-306-20/+43
| | | | | | | TUNSETOFFLOAD is only available on Linux Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: move tap_probe_vnet_hdr() to tap-linux.cMark McLoughlin2009-10-306-12/+27
| | | | | | | 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>
* net: move tap_set_sndbuf() to tap-linux.cMark McLoughlin2009-10-306-24/+42
| | | | | | | TUNSETSNDBUF is only available on linux Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: move linux code into net/tap-linux.cMark McLoughlin2009-10-303-47/+79
| | | | | Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* build: add CONFIG_LINUXMark McLoughlin2009-10-301-0/+4
| | | | | | | | So I can add a tap-linux.c and use CONFIG_LINUX to pull it in in Makefile Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: move AIX code into net/tap-aix.cMark McLoughlin2009-10-304-14/+33
| | | | | | | | | Okay, this makes the tap options available on AIX even though there's no support, but if we want to do it right we should have not compile the tap code at all on AIX using e.g. CONFIG_TAP. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: move solaris code to net/tap-solaris.cMark McLoughlin2009-10-304-165/+191
| | | | | Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: split BSD tap_open() out into net/tap-bsd.cMark McLoughlin2009-10-304-46/+69
| | | | | Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: split all the tap code out into net/tap.cMark McLoughlin2009-10-304-691/+763
| | | | | Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: move tap-linux.h under net/Mark McLoughlin2009-10-302-1/+1
| | | | | Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: move more stuff into net/tap-win32.c, add net/tap.hMark McLoughlin2009-10-306-75/+100
| | | | | Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: move tap-win32.c under net/Mark McLoughlin2009-10-302-1/+1
| | | | | Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: move net-checksum.c under net/Mark McLoughlin2009-10-307-9/+119
| | | | | | | Also add a new net/checksum.h header Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: move net-queue.[ch] under net/Mark McLoughlin2009-10-305-6/+10
| | | | | | | [v2: handle building in a separate dir] Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Revert "char: emit the OPENED event only when a new char connection is opened"Anthony Liguori2009-10-272-8/+1
| | | | | | | | This reverts commit 6cfa64de908d67fb6f6b6e3ae4888dd863f69e44. This breaks the monitor prompt. Proper fix will come from Amit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* really fix net.hAnthony Liguori2009-10-271-1/+1
| | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix signature of new_vlan_clientAnthony Liguori2009-10-271-1/+2
| | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio-net: add tap_has_ufo flag to saved stateMark McLoughlin2009-10-271-2/+21
| | | | | | | | | | | | | | | | If we tell the guest we support UFO and then migrate to host which doesn't support it, we will find ourselves in grave difficulties. Prevent this scenario by adding a flag to virtio-net's savevm format which indicates whether the device requires host UFO support. [v2: - add has_ufo uint8_t field for ease of vmstate conversion - use qemu_error() ] Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Enable UFO on virtio-net and tap devicesSridhar Samudrala2009-10-274-7/+44
| | | | | | | | | Enable UFO on the host tap device if supported and allow setting UFO on virtio-net in the guest. Signed-off-by: Sridhar Samudrala <sri@us.ibm.com> Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Work around dhclient brokennessAnthony Liguori2009-10-271-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | With the latest GSO/csum offload patches, any guest using an unpatched version of dhclient (any Ubuntu guest, for instance), will no longer be able to get a DHCP address. dhclient is actually at fault here. It uses AF_PACKET to receive DHCP responses but does not check auxdata to see if the packet has a valid csum. This causes it to throw out the DHCP responses it gets from the virtio interface as there is not a valid checksum. Fedora has carried a patch to fix their dhclient (it's needed for Xen too) but this patch has not made it into a release of dhclient. AFAIK, the patch is in the dhclient CVS but I cannot confirm since their CVS is not public. This patch, suggested by Rusty, looks for UDP packets (of a normal MTU) and explicitly adds a checksum to them if they are missing one. This allows unpatched dhclients to continue to work without needing to update the guest kernels. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio-net: enable tap offload if guest supports itMark McLoughlin2009-10-271-0/+18
| | | | | | | | We query the guest's feature set to see if it supports offload and, if so, we enable those features on the tap interface. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: add tap_set_offload()Mark McLoughlin2009-10-273-0/+32
| | | | | | | | | This API allows virtio-net to enable various offload features on a tap interface - e.g. to tell the host kernel it can pass up partial checksums to userspace. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio-net: add vnet_hdr supportMark McLoughlin2009-10-271-7/+44
| | | | | | | | | | | | | | | | | | | | With '-netdev tap,id=foo -nic model=virtio,netdev=foo' virtio-net can detect that its peer (i.e. the tap backend) supports vnet headers and advertise to the guest that it can send packets with partial checksums and/or TSO packets. One complication is that if we're migrating and the source host supports IFF_VNET_HDR but the destination host doesn't, we can't then stop the guest from using those features. In this scenario, we just fail the migration. [v2: - add has_vnet_hdr uint32_t field for ease of vmstate conversion - use qemu_error() ] Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: implement tap support for receive_raw()Mark McLoughlin2009-10-271-4/+19
| | | | | | | | | | | tap_receive_raw() always prepends a vnet header if IFF_VNET_HDR is enabled. tap_receive() only prepends when the a header is required but the NIC doesn't supply one. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: use qemu_send_packet_raw() in qemu_announce_self()Gleb Natapov2009-10-271-6/+1
| | | | | | | | | | | | | Use qemu_send_packet_raw to send gratuitous arp. This will ensure that vnet header is handled properly. Also, avoid sending the gratuitous packet to the guest. There doesn't appear to be any reason for doing that and the code will currently just crash if the NIC is not associated with a vlan. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: add receive_raw parameter to qemu_new_vlan_client()Mark McLoughlin2009-10-279-13/+16
| | | | | | | | | | Trivial patch to allow supplying a receive_raw function. A future cleanup should combine this function pointer parameters into a table. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: add an API for 'raw' packetsMark McLoughlin2009-10-273-8/+32
| | | | | | | | | | In the case where a NIC and backend agree on a packet header format, this API allows injecting packets which lack the agreed upon header. We need this for sending our gratuitous ARP. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: add flags parameter to packet queue interfaceMark McLoughlin2009-10-273-10/+36
| | | | | | | | This allows for the addition of a raw flag, and leaves the way open for other flags too. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: add tap_has_vnet_hdr() and tap_using_vnet_hdr() APIsMark McLoughlin2009-10-272-4/+38
| | | | | | | | | These lamely named functions allow virtio-net to query whether IFF_VNET_HDR is enabled on a tap interface and inform the tap code that virtio-net will supply packets with a vnet header. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: add a client type codeMark McLoughlin2009-10-279-14/+40
| | | | | | | | | This is so as to allow APIs which operate on specific client types without having to add a function table entry which is only implemented by a single client type. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: add a vnet_hdr=on|off parameterMark McLoughlin2009-10-272-11/+35
| | | | | | | | | | | | | This allows people to disable the IFF_VNET_HDR flag, e.g. for debugging purposes or if they know they may migrate the guest to a machine without IFF_VNET_HDR support. It also allows making the lack of IFF_VNET_HDR support an error condition, e.g. in the case where a guest is being migrated from a host which does support it. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: refactor tap initializationMark McLoughlin2009-10-271-45/+52
| | | | | | | | | | | | | Re-factor things so that there is only one call site for net_tap_fd_init(). Two concerns about the QemuOpts usage here - firstly, we set the script arguments to their default value and, secondly, we set the ifname value to the name allocated by the kernel if none is supplied. Are we okay with such things ending up in writeconfig output? Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: enable IFF_VNET_HDR on tap fds if availableMark McLoughlin2009-10-272-13/+84
| | | | | | | | | | | | For now, we just add an empty header before writing and strip the header after reading. We really only want IFF_VNET_HDR when virtio_net is using it, but it would significantly complicate matters to try and do that. There should be little or no performance impact with always adding headers. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: make tap_receive() re-use tap_receive_iov() codeMark McLoughlin2009-10-271-8/+15
| | | | | | | | | In future we will want to prepend a virtio_net header if the NIC didn't supply one but IFF_VNET_HDR is enabled on the interface. This is most easily achived by using writev() in all cases. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
OpenPOWER on IntegriCloud