summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2011-06-27Merge remote-tracking branch 'kraxel/usb.17' into stagingAnthony Liguori7-38/+91
2011-06-27Merge remote-tracking branch 'amit/for-anthony' into stagingAnthony Liguori1-10/+14
2011-06-27Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori16-37/+37
2011-06-27virtio-serial: Fix segfault on guest bootLuiz Capitulino1-10/+14
If I start qemu with: # qemu -hda disks/test.img -enable-kvm -m 1G -snapshot \ -device virtio-serial \ -chardev socket,host=localhost,port=1234,server,nowait,id=foo \ -device virtserialport,chardev=foo,name=org.qemu.guest_agent I get a segfault when booting a Fedora 14 guest. The backtrace says: Program terminated with signal 11, Segmentation fault. #0 0x0000000000420850 in handle_control_message (vser=0x3732bd0, buf=0x2c173e0, len=8) at /home/lcapitulino/src/qmp-unstable/hw/virtio-serial-bus.c:335 335 info = DO_UPCAST(VirtIOSerialPortInfo, qdev, port->dev.info); What's happening is VIRTIO_CONSOLE_DEVICE_READY is a message for the whole device, not for an individual port. So port is NULL. This bug was introduced by commit a15bb0d6a981de749452a5180fc8084d625671da. This commit fixes that by making the port returned by find_port_by_id() be used only by the VIRTIO_CONSOLE_PORT_READY and VIRTIO_CONSOLE_PORT_OPEN messages. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-06-26Remove exec-all.h include directivesBlue Swirl2-2/+0
Most exec-all.h include directives are now useless, remove them. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26Fix fallouts from Linux header inclusionJan Kiszka1-0/+10
This is an all-in-one fix for the smaller and bigger mistakes of the build system changes for accompanied Linux headers: - only enable KVM and vhost on Linux hosts - fix powerpc asm header symlink - do not use Linux headers on non-Linux hosts - fix kvmclock for !CONFIG_KVM - fix s390 build on non-Linux hosts Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Tested-by: Andreas Färber <andreas.faerber@web.de> Tested-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-24Fix comment typos in hw/armv7m.cMatthew Fernandez1-2/+2
Fix a couple of typos in comments. Signed-off-by: Matthew Fernandez <matthew.fernandez@gmail.com> Acked-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-24Spell "unkown" correctly in error_report() argumentsMarkus Armbruster6-11/+11
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-24Strip trailing '\n' from error_report()'s first argumentMarkus Armbruster9-24/+24
error_report() prepends location, and appends a newline. The message constructed from the arguments should not contain a newline. Fix the obvious offenders. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-23usb: ignore USB_DT_DEBUGGerd Hoffmann2-0/+5
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23usb-storage: Turn drive serial into a qdev property usb-storage.serialMarkus Armbruster1-3/+11
It needs to be a qdev property, because it belongs to the drive's guest part. Precedence: commit a0fef654 and 6ced55a5. Bonus: info qtree now shows the serial number. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23hw/usb-ohci.c: Fix handling of remote wakeup corner casesPeter Maydell1-3/+14
Correct a number of minor errors in the OHCI wakeup implementation: * when the port is suspended but the controller is not, raise RHSC * when the controller is suspended but the port is not, raise RD * when the controller is suspended, move it to resume state These fix some edge cases where a USB device might not successfully get the attention of the guest OS if it tried to do so at the wrong time. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23usb-bus: Don't allow speed mismatch while attaching devicesHans de Goede1-0/+5
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23usb: Add a speedmask to devicesHans de Goede3-0/+14
This is used to indicate at which speed[s] the device can operate, so that this can be checked to match the ports capabilities when it gets attached to a bus. Note that currently all usb1 emulated device claim to be fullspeed, this seems to not cause any problems, but still seems wrong, because with real hardware keyboards, mice and tablets usually are lo-speed, so reporting these as fullspeed devices seems wrong. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23usb: Proper error propagation for usb_device_attach errorsHans de Goede2-14/+16
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23usb-bus: Don't allow attaching a device to a bus with no free portsHans de Goede1-0/+5
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23ehci: switch to nanosecondsGerd Hoffmann1-18/+11
Make ehci use nanoseconds everywhere. Simplifies time calculations. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23ehci: add freq + maxframes propertiesGerd Hoffmann1-2/+12
Add properties for the wakeup rate and the max number of frames ehci will process at once. The wakeup rate defaults to 1000 which equals the usb frame rate. This can be reduced to make qemu wake up less often when ehci is active. In case the wakeup rate is reduced or the ehci timer is delayed due to latency issues elsewhere in qemu ehci will process multiple frames at once. The maxframes property specifies the upper limit for this. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-22net: Warn about "-net nic" options which were ignoredPeter Maydell1-0/+1
Diagnose the case where the user asked for a NIC via "-net nic" but the board didn't instantiate that NIC (for example where the user asked for two NICs but the board only supports one). Note that this diagnostic doesn't apply to NICs created through -device, because those are always instantiated. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-22Optimize screendumpAvi Kivity1-3/+10
When running kvm-autotest, fputc() is often the second highest (sometimes #1) function showing up in a profile. This is due to fputc() locking the file for every byte written. Optimize by buffering a line's worth of pixels and writing that out in a single call. Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-22Merge remote-tracking branch 'qemu-kvm/uq/master' into stagingAnthony Liguori1-9/+0
2011-06-22Merge remote-tracking branch 'mst/for_anthony' into stagingAnthony Liguori53-432/+552
Conflicts: hw/usb-uhci.c
2011-06-22Merge remote-tracking branch 'agraf/xen-next' into stagingAnthony Liguori8-39/+402
2011-06-20kvm: Drop CONFIG_KVM_PARAJan Kiszka1-9/+0
The kvm_para.h header is now always available. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-06-20lsi: Fix unused-but-set-variable warningChristophe Fergeau1-2/+0
This warning is new in gcc 4.6. Signed-off-by: Christophe Fergeau <cfergeau@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-19xen: Add the Xen platform pci deviceSteven Smith4-0/+349
Introduce a new emulated PCI device, specific to fully virtualized Xen guests. The device is necessary for PV on HVM drivers to work. Signed-off-by: Steven Smith <ssmith@xensource.com> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-19xen: fix interrupt routingStefano Stabellini3-38/+35
Compared to the last version I only added a comment to the code. - remove i440FX-xen and i440fx_write_config_xen we don't need to intercept pci config writes to i440FX anymore; - introduce PIIX3-xen and piix3_write_config_xen we do need to intercept pci config write to the PCI-ISA bridge to update the PCI link routing; - set the number of PIIX3-xen interrupts line to 128; Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-19cirrus_vga: reset lfb_addr after a pci config write if the BAR is unmappedStefano Stabellini1-1/+4
If the cirrus_vga PCI BAR is unmapped than we should not only reset map_addr but also lfb_addr, otherwise we'll keep trying to map the old lfb_addr in map_linear_vram. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-19xen: Add xc_domain_add_to_physmap to xen_interface.Anthony PERARD1-0/+14
This function will be used to support sync dirty bitmap. This come with a check against every Xen release, and special implementation for Xen version that doesn't have this specific call. This function will not be usable with Xen 3.3 because the behavior is different. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-16wdt: remove unused variablesMichael S. Tsirkin1-3/+0
Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2011-06-15usb-ehci: move device/vendor/class id to qdevMichael S. Tsirkin1-5/+4
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-06-15ppce500: move device/vendor/class id to qdevMichael S. Tsirkin1-10/+3
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-06-15pci: don't call qdev pci init methodIsaku Yamahata1-4/+6
As pci id initialization is moved to common layer, some initialization function can be empty. So don't call init method if NULL. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-06-15Merge remote-tracking branch 'origin/master' into pciMichael S. Tsirkin105-3048/+5163
Conflicts: hw/virtio-pci.c
2011-06-15hw/9118.c: Implement active-low interrupt supportPeter Maydell1-3/+9
The 9118 ethernet controller interrupt line is active low unless the IRQ config register is programmed to set both the IRQ_POL (polarity: active-high) and IRQ_TYPE (type: push-pull) bits: implement support for inverting the irq output in other configurations. This also requires that we support setting the bits in the first place, and that we correctly preserve them across software reset. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-06-15smc91c111: qdevify resetJuha Riihimäki1-5/+4
Register the smc91c111 reset function as a qdev reset function. Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-15Merge remote-tracking branch 'kraxel/usb.16' into stagingAnthony Liguori8-513/+816
2011-06-15Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori6-29/+267
2011-06-15ide: Clear error_status after restarting flushKevin Wolf1-7/+11
Clearing the error status flag was missing for restarting flushes. Now that the error status is separate from the BM status register, we can simply set it to 0 after restarting the request. This ensures that we never forget to clear a bit. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-15ide: add TRIM supportChristoph Hellwig5-5/+124
Add support for TRIM sub function of the data set management command, and wire it up to the qemu discard infrastructure. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-15ide: allow other dma comands than read and writeChristoph Hellwig4-17/+33
Replace the is_read flag with a dma_cmd flag to allow the dma and restart logic to handler other commands like TRIM. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-15ide: Add forgotten VMSTATE_END_OF_LIST in subsectionKevin Wolf1-0/+1
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-15ide: Fix ide_drive_pio_state_needed()Kevin Wolf1-1/+2
When a failed PIO request caused the VM to stop, we still need to transfer the PIO state even though DRQ=0 at this point. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-15ide: Split error status from status registerKevin Wolf4-8/+105
When adding the werror=stop mode, some flags were added to s->status which are used to determine what kind of operation should be restarted when the VM is continued. Unfortunately, it turns out that s->status is in fact a device register and as such is visible to the guest (some of the abused bits are even writable for the guest). For migration we keep on using the old VMState field (renamed to migration_compat_status) if the status register doesn't use any of the previously abused bits. If it does, we use a subsection with a clean copy of the status register. The error status is always sent in a subsection if there is any error. It can't use the old field because errors happen even without PCI. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-14usb-ccid: Plug memory leak on qdev exit()Markus Armbruster1-20/+8
ccid_initfn() allocates CCIDBus dynamically, but there is no exit callback to free it. Fix by getting rid of the allocation. Signed-off-by: Markus Armbruster <armbru@redhat.com>
2011-06-14print meaningful error message in case of --disable-vhost-netMichael Tokarev1-0/+2
When qemu gets compiled without support of vhost-net, any attempt to use it fails with a very clear error message: qemu-system-x86_64: -netdev ...,vhost=on: vhost-net requested but could not be initialized there's absolutely no reason given _why_ it coult not be initialized, and even strace'ing the process in question does not reveal any errors. So print a message telling what's going on. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-06-14virtio: compat event idx supportMichael S. Tsirkin1-0/+48
Disable event index for compat machine types. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-06-14usb-uhci: fix expire time initialization.Gerd Hoffmann1-2/+2
expire_time must be initialited when the guest activates the usb scheduler, not at device creation time. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14hw/usb-ohci.c: Implement remote wakeupPeter Maydell1-0/+17
Implement the wakeup callback in the OHCI USBPortOps, so that when a downstream device wakes up it correctly causes the OHCI controller to come out of suspend. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14hw/usb-ohci.c: Ignore writes to HcPeriodCurrentED registerPeter Maydell1-0/+4
HcPeriodCurrentED is read-only, but Linux writes to it anyway; silently ignore this rather than printing a warning message. (Specifically, drivers/usb/host/ohci-hub.c:ohci_rh_resume() writes a 0, in at least kernels 2.6.25 through 2.6.39.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>