aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2012-02-29Merge remote-tracking branch 'kraxel/usb.39' into stagingAnthony Liguori20-245/+317
* kraxel/usb.39: (21 commits) usb: Resolve warnings about unassigned bus on usb device creation usb-redir: Return USB_RET_NAK when we've no data for an interrupt endpoint usb-redir: Limit return values returned by iso packets usb-redir: Let the usb-host know about our device filtering usb-redir: Always clear device state on filter reject usb-redir: Fix printing of device version ehci: drop old stuff usb-ehci: Handle ISO packets failing with an error other then NAK libcacard: fix reported ATR length usb-ccid: advertise SELF_POWERED libcacard: link with glib for g_strndup usb-desc: fix user trigerrable segfaults (!config) usb-ehci: sanity-check iso xfers usb: add tracepoint for usb packet state changes. usb-xhci: enable packet queuing usb-uhci: implement packet queuing usb-uhci: process uhci_handle_td return code via switch. usb-uhci: add UHCIQueue usb-uhci: cleanup UHCIAsync allocation & initialization. usb-ehci: fix reset ...
2012-02-27Merge remote-tracking branch 'aneesh/for-upstream' into stagingAnthony Liguori3-9/+26
* aneesh/for-upstream: hw/9pfs: Endian fixes for virtfs ./configure: add option for disabling VirtFS
2012-02-27usb: Resolve warnings about unassigned bus on usb device creationJan Kiszka9-34/+26
When creating an USB device the old way, there is no way to specify the target bus. Thus the warning issued by usb_create makes no sense and rather confuses our users. Resolve this by passing a bus reference to the usbdevice_init handler and letting those handlers forward it to usb_create. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-27slirp: Fix assertion failure on rejected DHCP requestsDavid Gibson1-1/+2
The guest network stack might DHCPREQUEST an address that the slirp built in dhcp server can't let it have - for example if the guest has an old leases file from another network configuration. In this case the dhcp server should and does reject the request and prepares to send a DHCPNAK to the client. However, in this case the daddr variable in bootp_reply() is set to 0.0.0.0. Shortly afterwards, it unconditionally attempts to pre-insert the new client address into the ARP table. This causes an assertion failure in arp_address_add() because of the 0.0.0.0 address. According to RFC2131, DHCPNAK messages for clients on the same subnet must be sent to the broadcast address (S3.2, subpoint 2). Cc: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2012-02-27slirp: Refactor if_startJan Kiszka1-42/+36
Replace gotos with a while loop, fix coding style. CC: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> CC: Fabien Chouteau <chouteau@adacore.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2012-02-27slirp: Fix requeuing of batchq packets in if_startJan Kiszka1-16/+19
In case we requeued a packet that was the head of a longer session queue, we failed to restore this ordering. Also, we did not properly deal with changes to Slirp::next_m. Instead of a cumbersome roll back, this fix simply avoids any changes until we know if the packet was actually sent. Both fixes crashes due to inconsistent queues and simplifies the logic. Thanks to Zhi Yong Wu who found the reason for these crashes. CC: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> CC: Fabien Chouteau <chouteau@adacore.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2012-02-27slirp: Clean up ifs_initJan Kiszka3-4/+5
Remove duplicate ifs_init macros, reimplement the logic as static inline in mbuf.h. CC: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> CC: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2012-02-27usb-redir: Return USB_RET_NAK when we've no data for an interrupt endpointHans de Goede1-1/+4
We should return USB_RET_NAK, rather then a 0 sized packet, when we've no data for an interrupt IN endpoint. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-27usb-redir: Limit return values returned by iso packetsHans de Goede1-2/+2
The usbredir protocol uses a status of usb_redir_stall to indicate that an iso data stream has stopped (ie because the urbs failed on resubmit), but iso packets should never return a result of USB_RET_STALL, since iso endpoints cannot stall. So instead simply always return USB_RET_NAK on iso stream errors. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-27usb-redir: Let the usb-host know about our device filteringHans de Goede2-1/+21
libusbredirparser-0.3.4 adds 2 new packets which allows us to notify the usb-host: -about the usb device filter we have (if any), so that it knows not the even try to redirect certain devices -when we reject a device based on filtering (in case it tries anyways) Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-27usb-redir: Always clear device state on filter rejectHans de Goede1-4/+7
Always call usbredir_device_disconnect() when usbredir_check_filter() fails to clean up all the device state (ie received endpoint info). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-27usb-redir: Fix printing of device versionHans de Goede1-2/+4
The device version is in bcd format, which requires some special handling to print. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-27ehci: drop old stuffGerd Hoffmann1-29/+1
Drop the "ehci under development" banner. Drop unused & inactive (#if 0) code. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-27usb-ehci: Handle ISO packets failing with an error other then NAKHans de Goede1-3/+19
Before this patch the ehci code was not checking for any other errors other then USB_RET_NAK. This causes 2 problems: 1) Other errors are not reported to the guest. 2) When transactions with the ITD_XACT_IOC bit set completing with another error would not result in USBSTS_INT getting set. I hit this problem when unplugging devices while iso data was streaming from the device to the guest. When this happens it takes a while for the guest to process the unplugging and remove ISO transactions from the ehci schedule, in the mean time these transactions would complete with a result of USB_RET_NODEV, which was not handled. This lead to the Linux guest's usb subsystem "hanging", that is it would no longer see new usb devices getting plugged in and running for example lsusb would lead to a stuck (D state) lsusb process. This patch fixes this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-27libcacard: fix reported ATR lengthAlon Levy1-2/+2
Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-27usb-ccid: advertise SELF_POWEREDAlon Levy1-1/+1
Before commit ed5a83ddd8c1d8ec7b1015315530cf29949e7c48 each device provided it's own response to USB_REQ_GET_STATUS, but after it that response was based on bmAttributes, which was errounously set for usb-ccid as 0xa0 and not 0xe0. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-27libcacard: link with glib for g_strndupAlon Levy1-2/+2
Without it the produced library for make libcacard.la has an unresolved symbol. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-27usb-desc: fix user trigerrable segfaults (!config)Alon Levy1-3/+17
Check for dev->config being NULL in two places: USB_REQ_GET_CONFIGURATION and USB_REQ_GET_STATUS. The behavior of USB_REQ_GET_STATUS is unspecified in the Default state, that corresponds to dev->config being NULL (it defaults to NULL and is reset whenever a SET_CONFIGURATION with value 0, or attachment). I implemented it to correspond with the state before ed5a83ddd8c1d8ec7b1015315530cf29949e7c48, the commit moving SET_STATUS to usb-desc; if dev->config is not set we return whatever is in the first configuration. The behavior of USB_REQ_GET_CONFIGURATION is also undefined before any SET_CONFIGURATION, but here we just return 0 (same as specified for the Address state). A win7 guest failed to initialize the device before this patch, segfaulting when GET_STATUS was called with dev->config == NULL. With this patch the passthrough device still doesn't work but the failure is unrelated. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-27usb-ehci: sanity-check iso xfersGerd Hoffmann1-6/+10
This patch adds a sanity check to itd processing to make sure the endpoint addressed by the guest is actually an iso endpoint. Also verify that usb drivers don't return USB_RET_ASYNC which is illegal for iso xfers. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-27usb: add tracepoint for usb packet state changes.Gerd Hoffmann2-22/+8
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-27usb-xhci: enable packet queuingGerd Hoffmann1-6/+0
qemu usb core has packet queues now, so flip lets the switch. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-27usb-uhci: implement packet queuingGerd Hoffmann1-2/+31
When a usb device is busy processing a packet (and returns USB_RET_ASYNC), continue walking the transfer descriptor list and process them to fill the request queue. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-27usb-uhci: process uhci_handle_td return code via switch.Gerd Hoffmann1-27/+39
Restruct the uhci_handle_td return code processing to make the control flow more clear and the code more readable. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-27usb-uhci: add UHCIQueueGerd Hoffmann1-91/+118
UHCIAsync structs (in-flight requests) grouped in UHCIQueue now. Each (active) usb endpoint gets its own UHCIQueue. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-27usb-uhci: cleanup UHCIAsync allocation & initialization.Gerd Hoffmann1-7/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-27usb-ehci: fix resetGerd Hoffmann1-1/+2
Two reset fixes: * pick up s->usbcmd value after ehci_reset call to make sure it keeps the reset value and doesn't get rubbish filled in when val is written back to the mmio register array later on. * make sure the frame timer is zapped on reset. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-27usb-hid: fix tablet activationGerd Hoffmann1-0/+3
Activate usb hid pointer devices (mouse+tablet) unconditionally on polls, even if we NAK the poll due to lack of new events. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-25audio: Add some fall through commentsStefan Weil2-1/+4
Static code analysers expect these comments for case statements without a break statement. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: malc <av1474@comtv.ru>
2012-02-24configure: Check whether makecontext() is a glibc stub functionPeter Maydell1-0/+4
On some systems (notably ARM Linux) glibc provides implementations of makecontext(), getcontext() and friends which are stubs which always return failure. Make the configure test for makecontext() also check for the presence of the __stub_makecontext macro which indicates the presence of these stubs, so we can avoid trying to use them and fall back to a different coroutine implementation instead. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24vl.c: Avoid segfault when started with no argumentsPeter Maydell1-7/+10
Fix a bug (introduced in commit a0abe47) where a command line which specified no machine arguments (either explicitly or implicitly via -kernel &co) would result in a segfault because of a NULL pointer returned from qemu_opts_find(qemu_find_opts("machine"), 0). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24nic: zap obsolote romloading bits from ne2k + pcnetGerd Hoffmann2-16/+2
These days one just needs to specify the romfile in PCiDeviceInfo and everything magically works. It also allows to disable pxe rom loading via "romfile=<emptystring>" like it is possible for all other nics. [ v2: rebased & adapted to qom changes ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24build: allow turning off debuginfoGerd Hoffmann1-2/+13
This patch adds --{enable,disable}-debug-info switches to configure which allows to include/exclude the '-g' switch on the gcc & ld command lines. Not building debug info reduces ressource usage (especially disk) alot and is quite useful for test builds. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24optimize screendump for the common non-switch caseGerd Hoffmann9-21/+34
switch console only if needed, also pass down whenever the console was switched or not because a displaysurface redraw is only needed in case the console was switched. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24Remove screendump dummy functions.Gerd Hoffmann3-12/+4
The code in console.c verifies whenever a screen_dump function pointer is present before calling it, so there is no need to supply an dummy function. Remove them. Also report an error to notify the user that he didn't got a screenshot. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24vga: simplify screendumpGerd Hoffmann1-35/+1
The displaychangelistener isn't needed at all, we can simply save the image when vga_hw_update is done instead of hooking into the update process. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24suspend: add qmp eventsGerd Hoffmann3-0/+10
Send qmp events on suspend and wakeup so libvirt has a chance to track the vm state. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24suspend: make acpi timer wakeup the guest.Gerd Hoffmann2-0/+9
Make the acpi timer wake up the guest. Guests can enable/disable this via acpi too. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24suspend: make rtc alarm wakeup the guest.Gerd Hoffmann3-0/+9
Make the rtc wake up the guest when the alarm fires. Add acpi windup to property support RTC_EN, so guests can enable and disable this. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24suspend: make serial ports wakeup the guest.Gerd Hoffmann1-0/+6
Add a 'wakeup' property to the serial port. It is off by default. When enabled any incoming character on the serial line will wake up the guest. Useful for guests which have a serial console configured. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24suspend: make ps/2 devices wakeup the guestGerd Hoffmann1-0/+6
This patch adds wakeup support to ps/2 emulation. Any key press on the ps/2 keyboard will wakeup the guest. Likewise any mouse button press will wakeup the guest. Mouse moves are ignored, so the guest will not wakeup in case your mouse crosses the vnc window of a suspended guest by accident. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24suspend: add system_wakeup monitor commandGerd Hoffmann6-0/+57
This patch adds the system_wakeup monitor command which will simply wake up suspended guests. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24suspend: switch acpi s3 to new infrastructure.Gerd Hoffmann10-42/+47
This patch switches pc s3 suspend over to the new infrastructure. The cmos_s3 qemu_irq is killed, the new notifier is used instead. The xen hack goes away with that too, the hypercall can simply be done in a notifier function now. This patch also makes the guest actually stay suspended instead of leaving suspend instantly, so it is useful for more than just testing whenever the suspend/resume cycle actually works. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24suspend: add infrastructureGerd Hoffmann2-0/+76
This patch adds some infrastructure to handle suspend and resume to qemu. First there are two functions to switch state and second there is a suspend notifier: * qemu_system_suspend_request is supposed to be called when the guest asks for being be suspended, for example via ACPI. * qemu_system_wakeup_request is supposed to be called on events which should wake up the guest. * qemu_register_suspend_notifier can be used to register a notifier which will be called when the guest is suspended. Machine types and device models can hook in there to modify state if needed. * qemu_register_wakeup_notifier can be used to register a notifier which will be called when the guest is woken up. Machine types and device models can hook in there to modify state if needed. * qemu_system_wakeup_enable can be used to enable/disable wakeup events. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24acpi: add acpi_pm1_evt_write_enGerd Hoffmann4-2/+8
Do APCIREGS->pm1.evt.en updates using the new acpi_pm1_evt_write_en function, so the acpi code will see those updates. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24acpi: don't pass overflow_time to acpi_pm1_evt_get_stsGerd Hoffmann4-8/+8
Pretty pointless, can easily be reached via ACPIREGS now. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24acpi: add ACPIREGSGerd Hoffmann4-143/+145
All those acpi structs are not independent from each other. Various acpi functions expecting multiple acpi structs passed in are a clean indicator for that ;) So this patch bundles all acpi structs in the new ACPIREGS struct, then use it everythere pass around acpi state. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24acpi: move around structsGerd Hoffmann1-25/+23
Group all structs at the top of hw/acpi.h. Just moving around lines, no code changes. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori3-28/+9
* stefanha/trivial-patches: slirp/misc: fix gcc __warn_memset_zero_len warnings vl.c: Increase width of machine name column in "-M ?" output tcg: Remove unneeded include statements
2012-02-24Merge remote-tracking branch 'mdroth/qga-win32-pull-2-23-12' into stagingAnthony Liguori14-318/+1263
* mdroth/qga-win32-pull-2-23-12: qemu-ga: add win32 guest-shutdown command qemu-ga: add Windows service integration qemu-ga: add initial win32 support qemu-ga: fixes for win32 build of qemu-ga qemu-ga: rename guest-agent-commands.c -> commands-posix.c qemu-ga: separate out common commands from posix-specific ones qemu-ga: move channel/transport functionality into wrapper class qemu-ga: Add schema documentation for types
2012-02-24Merge remote-tracking branch 'qmp/queue/qmp' into stagingAnthony Liguori12-62/+104
* qmp/queue/qmp: qmp: add DEVICE_TRAY_MOVED event ide: drop ide_tray_state_post_load() block: Don't call bdrv_eject() if the tray state didn't change block: bdrv_eject(): Make eject_flag a real bool block: Rename bdrv_mon_event() & BlockMonEventAction