summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* MAINTAINERS: add entry for XenStefano Stabellini2011-08-051-0/+10
| | | | | | Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qcow2: Fix L1 table size after bdrv_snapshot_gotoKevin Wolf2011-08-051-5/+11
| | | | | | | | | | | | | | When loading an internal snapshot whose L1 table is smaller than the current L1 table, the size of the current L1 would be shrunk to the snapshot's L1 size in memory, but not on disk. This lead to incorrect refcount updates and eventuelly to image corruption. Instead of writing the new L1 size to disk, this simply retains the bigger L1 size that is currently in use and makes sure that the unused part is zeroed. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Tested-by: Philipp Hahn <hahn@univention.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote-tracking branch 'mst/for_anthony' into stagingAnthony Liguori2011-08-0410-31/+79
|\
| * vhost: remove an incorrect assertMichael S. Tsirkin2011-08-031-1/+0
| | | | | | | | | | | | | | | | | | | | The 'to' can go negative when the first region gets removed (it gets incremented by to 0 immediately afterward), which makes the assertion fail. Nothing breaks if to < 0 here so just remove the assert. Tested-by: David Ahern <daahern@cisco.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pcie_host: verify mmcfg address rangeIsaku Yamahata2011-07-291-6/+22
| | | | | | | | | | | | | | | | | | | | | | For a conventional pci device behind a pcie-to-pci bridge, pci_host handlers get confused by an out of bounds access in the range [256, 4K). Check for such an access and make it have no effect. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * virtio: Plug memleak by freeing vdevAmit Shah2011-07-271-0/+1
| | | | | | | | | | | | | | | | | | virtio_common_init() allocates RAM for the vdev struct (and any additional memory, depending on the size passed to the function). This memory wasn't being freed until now. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * virtio-net: don't use vdev after virtio_cleanupAmit Shah2011-07-271-1/+1
| | | | | | | | | | | | | | | | | | virtio_cleanup() will be changed by the following patch to remove the VirtIONet struct that gets allocated via virtio_common_init(). Ensure we don't dereference the structure after calling the cleanup function. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * virtio-blk: Fix memleak on exitAmit Shah2011-07-271-0/+1
| | | | | | | | | | | | | | | | Calling virtio_cleanup() will free up memory allocated in virtio_common_init(). Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * virtio-pci: use generic logic for command accessMichael S. Tsirkin2011-07-271-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In practice, guests don't generate config requests that cross a word boundary, so the logic to detect command word access is correct because PCI_COMMAND is 0x4. But depending on this is tricky, further, it will break with guests that do try to generate a misaligned access as we pass it to devices without splitting. Better to use the generic range_covers_byte for this. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: Common overflow preventionJan Kiszka2011-07-274-14/+34
| | | | | | | | | | | | | | | | | | | | Introduce pci_config_read/write_common helpers to prevent passing accesses down the callback chain that go beyond the config space limits. Adjust length assertions as they are no longer correct (cutting may generate valid 3 byte accesses). Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * Fix netdev name lookup in -device, device_add, netdev_delMarkus Armbruster2011-07-191-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qemu_find_netdev() looks up members of non_vlan_clients by name. It happily returns the first match. Trouble is the names need not be unique. non_vlan_clients contains host parts (netdevs) and guest parts (NICs). Netdevs have unique names: a netdev's name is a (mandatory) qemu_netdev_opts ID, and these are unique. NIC names are not unique. If a NIC has a qdev ID (which is unique), that's its name. Else, we make up a name. The made-up names are unique, but they can clash with qdev IDs. Even if NICs had unique names, they could still clash with netdev names. Callers of qemu_find_netdev(): * net_init_nic() wants a netdev. It happens to work because it runs before NICs get added to non_vlan_clients. * do_netdev_del() wants a netdev. If it gets a NIC, it complains and fails. Bug: a netdev with the same name that comes later in non_vlan_clients can't be deleted: $ qemu-system-x86_64 -nodefaults -vnc :0 -S -monitor stdio -netdev user,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=virtio1 [...] (qemu) netdev_add user,id=virtio1 (qemu) info network Devices not on any VLAN: hostnet0: net=10.0.2.0, restricted=n peer=virtio1 virtio1: model=virtio-net-pci,macaddr=52:54:00:12:34:56 peer=hostnet0 virtio1: net=10.0.2.0, restricted=n (qemu) netdev_del virtio1 Device 'virtio1' not found * parse_netdev() wants a netdev. If it gets a NIC, it gets confused. With the test setup above: (qemu) device_add virtio-net-pci,netdev=virtio1 Property 'virtio-net-pci.netdev' can't take value 'virtio1', it's in use You can even connect two NICs to each other: $ qemu-system-x86_64 -nodefaults -vnc :0 -S -monitor stdio -device virtio-net-pci,id=virtio1 -device e1000,netdev=virtio1 [...] Devices not on any VLAN: virtio1: model=virtio-net-pci,macaddr=52:54:00:12:34:56 peer=e1000.0 e1000.0: model=e1000,macaddr=52:54:00:12:34:57 peer=virtio1 (qemu) q Segmentation fault (core dumped) * do_set_link() works fine for both netdevs and NICs. Whether it really makes sense for netdevs is debatable, but that's outside this patch's scope. Change qemu_find_netdev() to return only netdevs. This fixes the netdev_del and device_add/-device bugs demonstrated above. To avoid changing set_link, make do_set_link() search non_vlan_clients by hand instead of calling qemu_find_netdev(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * Fix automatically assigned network names for netdevMarkus Armbruster2011-07-191-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a network client doesn't have a name, we make one up, with assign_name(). assign_name() creates a name MODEL.NUM, where MODEL is the client's model, and NUM is the number of MODELs that already exist. Bug: it misses clients that are not on a VLAN, i.e. netdevs and the NICs using them: $ qemu-system-x86_64 -nodefaults -vnc :0 -S -monitor stdio -netdev user,id=hostnet0 -net nic,netdev=hostnet0 -netdev user,id=hostnet1 -net nic,netdev=hostnet1 QEMU 0.14.50 monitor - type 'help' for more information (qemu) info network Devices not on any VLAN: hostnet0: net=10.0.2.0, restricted=n peer=e1000.0 hostnet1: net=10.0.2.0, restricted=n peer=e1000.0 e1000.0: model=e1000,macaddr=52:54:00:12:34:56 peer=hostnet0 e1000.0: model=e1000,macaddr=52:54:00:12:34:57 peer=hostnet1 Fix that. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* | Merge remote-tracking branch 'alon/pull-libcacard.data' into stagingAnthony Liguori2011-08-041-3/+2
|\ \
| * | libcacard: use INSTALL_DATA for dataAlon Levy2011-08-021-3/+2
| | | | | | | | | | | | Signed-off-by: Alon Levy <alevy@redhat.com>
* | | Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori2011-08-043-4/+3
|\ \ \
| * | | Makefile: delete config.log in distcleanAlexandre Raymond2011-08-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Distclean should remove anything created by the configure script. Signed-off-by: Alexandre Raymond <cerbere@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
| * | | HMP: Remove the duplicated info "info kvm" in hmp-commands.hx.Zhi Yong Wu2011-08-031-2/+0
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
| * | | configure: display "no" for disabled kvm/vhost-netBrad2011-08-031-2/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix configure display for non-Linux OS's and the KVM / vhost-net features to show "no" output instead of nothing at the end of the line. Signed-off-by: Brad Smith <brad@comstyle.com> Acked-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* | | Merge remote-tracking branch 'spice/spice.v40' into stagingAnthony Liguori2011-08-045-69/+528
|\ \ \
| * | | qxl: bump pci revGerd Hoffmann2011-08-032-7/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inform guest drivers about the new features I/O commands we have now (async commands, S3 support) if building with newer spice, i.e. if SPICE_INTERFACE_QXL_MINOR >= 1. sneaked in some 81+ column line spliting. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Alon Levy <alevy@redhat.com>
| * | | qxl: add QXL_IO_FLUSH_{SURFACES,RELEASE} for guest S3&S4 supportAlon Levy2011-08-031-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add two new IOs. QXL_IO_FLUSH_SURFACES - equivalent to update area for all surfaces, used to reduce vmexits from NumSurfaces to 1 on guest S3, S4 and resolution change (windows driver implementation is such that this is done on each of those occasions). QXL_IO_FLUSH_RELEASE - used to ensure anything on last_release is put on the release ring for the client to free. Signed-off-by: Yonit Halperin <yhalperi@redhat.com> Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | qxl: async io support using new spice apiAlon Levy2011-08-035-56/+276
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the QXL port i/o commands are waiting for the spice server to complete certain actions. Add async versions for these commands, so we don't block the vcpu while the spice server processses the command. Instead the qxl device will raise an IRQ when done. The async command processing relies on an added QXLInterface::async_complete and added QXLWorker::*_async additions, in spice server qxl >= 3.1 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Alon Levy <alevy@redhat.com>
| * | | qxl: only disallow specific io's in vga modeAlon Levy2011-08-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the driver is still in operation even after moving to UNDEFINED, i.e. by destroying primary in any way. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | qxl: make qxl_guest_bug take variable argumentsAlon Levy2011-08-012-3/+8
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | qxl: error handling fixes and cleanups.Gerd Hoffmann2011-08-012-5/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add qxl_guest_bug() function which is supposed to be called in case sanity checks of guest requests fail. It raises an error IRQ and logs a message in case guest debugging is enabled. Make PANIC_ON() abort instead of exit. That macro should be used for qemu bugs only, any guest-triggerable stuff should use the new qxl_guest_bug() function instead. Convert a few easy cases from PANIC_ON() to qxl_guest_bug() to show intended usage. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | qxl: add io_port_to_stringAlon Levy2011-08-011-1/+39
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | qxl: fix surface tracking & lockingGerd Hoffmann2011-08-012-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Surface tracking needs proper locking since it is used from vcpu and spice worker threads, add it. Also reset the surface counter when zapping all surfaces. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | spice/qxl: move worker wrappersGerd Hoffmann2011-08-015-70/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the wrapper functions which are used by qxl only to qxl.c. Rename them from qemu_spice_* to qxl_spice_*. Also pass in a qxl state pointer instead of a SimpleSpiceDisplay pointer. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | spice: add qemu_spice_display_init_commonGerd Hoffmann2011-08-013-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Factor out SimpleSpiceDisplay initialization into qemu_spice_display_init_common() and call it from both qxl.c (for vga mode) and spice-display.c Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | spice: add worker wrapper functions.Gerd Hoffmann2011-08-014-24/+129
| |/ / | | | | | | | | | | | | | | | Add wrapper functions for all spice worker calls. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | | Merge remote-tracking branch 'kiszka/queues/slirp' into stagingAnthony Liguori2011-08-0410-98/+241
|\ \ \
| * | | Delayed IP packetsFabien Chouteau2011-08-035-37/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the current implementation, if Slirp tries to send an IP packet to a client with an unknown hardware address, the packet is simply dropped and an ARP request is sent (if_encap in slirp/slirp.c). With this patch, Slirp will send the ARP request, re-queue the packet and try to send it later. The packet is dropped after one second if the ARP reply is not received. Signed-off-by: Fabien Chouteau <chouteau@adacore.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
| * | | Simple ARP tableFabien Chouteau2011-08-035-59/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a simple ARP table in Slirp and also adds handling of gratuitous ARP requests. Signed-off-by: Fabien Chouteau <chouteau@adacore.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
| * | | slirp: Take maintainer tokenJan Kiszka2011-08-031-2/+3
| |/ / | | | | | | | | | | | | | | | | | | Anthony asked me to pick up the maintenance of this subsystem, and I agreed. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
* | | Merge remote-tracking branch 'kraxel/usb.22' into stagingAnthony Liguori2011-08-0427-859/+1088
|\ \ \
| * | | bluetooth: kill dummy usb device, use hid code directly.Gerd Hoffmann2011-08-041-40/+22
| | | | | | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | hid: move idle+protocol from usb-hid to hid too.Gerd Hoffmann2011-08-043-23/+25
| | | | | | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | usb-hid: split hid code to hw/hid.[ch]Gerd Hoffmann2011-08-044-395/+452
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Almost pure code motion. Unstatic hid interface functions and add them to the header file. Some renames. Some code style cleanups. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | usb-hid: add hid_has_events()Gerd Hoffmann2011-08-041-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add hid_has_events function, use it to figure whenever there are pending events instead of checking and updating USBHIDState->changed. Setting ->changed to 1 on init is removed, that should have absolutely no effect as the initial state of ->idle is 0 so we report hid state anyway until the guest configures some idle time. Also should clear ->idle on reset. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | usb-hid: add event callbackGerd Hoffmann2011-08-041-43/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add callback for event notification, which allows to un-usbify more functions. Also split separate hid_* functions for reset and release. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | usb-hid: create & use HIDStateGerd Hoffmann2011-08-041-148/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First step in separating out the HID emulation code from usb-hid, so it can be reused without creating a dummy usb device like bluetooth does. This creates a HIDState struct, moves the non-usbish fields from USBHIDStruct there. Renames non-usbish structs, defines and functions from usb* to hid*. Adapts the code to that. Also cleans up a bunch of code style issues along the way. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | ehci: iovec support, remove bufferGerd Hoffmann2011-08-041-86/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Map guest memory and pass on a direct pointer instead of copying the bits to a indirect buffer. EHCI transfer descriptors can reference multiple (physical guest) pages so we'll actually start seeing usb packets wich carry iovec with more than one element. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | uhci: remove bufferGerd Hoffmann2011-08-041-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Map guest memory and pass on a direct pointer instead of copying the bits to a indirect buffer. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | usb-storage: iovec supportGerd Hoffmann2011-08-041-58/+49
| | | | | | | | | | | | | | | | | | | | | | | | Add full iovec support to usb-storage. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | usb-host: iovec supportGerd Hoffmann2011-08-041-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add full support for iovecs to usb-host. The code can split large transfers into smaller ones already, we are using this to also split requests at iovec borders. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | usb-serial: iovec supportGerd Hoffmann2011-08-041-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | Add full support for iovecs to usb-serial. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | usb: use iovecs in USBPacketGerd Hoffmann2011-08-0421-222/+338
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Zap data pointer from USBPacket, add a QEMUIOVector instead. Add a bunch of helper functions to manage USBPacket data. Switch over users to the new interface. Note that USBPacket->len was used for two purposes: First to pass in the buffer size and second to return the number of transfered bytes or the status code on async transfers. There is a new result variable for the latter. A new status code was added to catch uninitialized result. Nobody creates iovecs with more than one element (yet). Some users are (temporarely) limited to iovecs with a single element to keep the patch size as small as possible. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | move QEMUSGList typedefGerd Hoffmann2011-08-042-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the QEMUSGList typedef to qemu-common so it can easily be used. The actual struct definition stays in dma.h. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | Add iov_clear()Gerd Hoffmann2011-08-042-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | Fill the spefified area with zeros. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | Add iov_hexdump()Gerd Hoffmann2011-08-042-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | Useful for debugging purposes. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
OpenPOWER on IntegriCloud