summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-03-19unifying: rename input queue, fix error queuePeter Wu2-14/+40
Fix error queue name, rename input queue for clarity. Split input and output queue for further work and NAK when there is no interrupt data available.
2014-03-18unifying: WIP for HID++ supportPeter Wu4-14/+326
Error queue is implemented, possible receiver and device properties are filled in (in the header). Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-17unifying: move definitions to headerPeter Wu2-19/+47
Prepare for adding DJ support, which I expect to be huge and unrelated to the HID code. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-17usbdump: fix endpoint lookupPeter Wu1-5/+9
bNumEndpoints specify the number of endpoints in the endpoint descriptor. When the mouse endpoint was tried (EP2), it triggered this assertion because there is only one endpoint for the interface. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-17unifying: support HID Get_Report and Set_ReportPeter Wu1-8/+13
Copied from dev-hid.c (order changed to match interfaces order). Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-17unifying: implement basic HID processingPeter Wu1-22/+143
For now, the receiver has always a mouse and keyboard paired. Set_Idle, Get_Idle, Get_Protocol and Set_Protocol support interface-specific devices. Interrupt data for the HID mode are also implemented. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-17usbdump: do not hard-code bus number, use nr from USBBusPeter Wu1-1/+3
Instead of changing bus.c (next_usb_bus) and possibly breaking configurations relying on this number, just add one in the dump code for cosmetic purposes. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: fix start time offset of capturePeter Wu1-3/+2
There is still a discrepancy (seen 300 ms and 600 ms), but it is better than completely a difference equal to the uptime. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usb-hid: usbdump example for control and interrupt INPeter Wu1-0/+17
This is verified to reproduce the same capture as done inside the VM. The differences are in time, bInterval, URB length, URB ID and the Copy of transfer flags. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: comments updatePeter Wu2-3/+28
And I was wondering why the interrupt packets in dev-hid.c had a reversed type marking...
2014-03-16usbdump: fix IN marking for non-control packetsPeter Wu1-2/+8
Non-control transfers have a meaningless setup buffer. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: constantify variablesPeter Wu2-17/+17
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: fix reversal of URB length and captured lengthPeter Wu1-4/+11
The "length" field stores the expected size of data. "len_cap" stores the real length of the data in the current packet (the "captured" data). Also try to set a slightly more sane length value depending on submission type, but this is much braindead. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: fix interval retrieval for endpointPeter Wu1-2/+4
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: initial API extension for handle_dataPeter Wu2-1/+83
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: fail early if dump file is not availablePeter Wu3-8/+15
This allows for less less checking by the consumer and avoids unnecessary work if the capture cannot be written anyway. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16net/dump: simplify timestamp calculationPeter Wu1-5/+3
The timestamp calculation in dump_receive is very unobvious now and looks completely arbitrary. qemu_clock_get_us already returns micro- seconds, so use that instead of manual calculating with nanoseconds. While at it, express the private start_ts field in microseconds too instead of seconds. This is supposed to yield a more accurate initial timestamp (based on host clock). NOTE: this patch ignores the RTC of the guest! Perhaps this part should be reverted.
2014-03-16unifying: remove unused leftover from dev-wacomPeter Wu1-186/+7
To make a tidy ship, remove unused parts that were taken from dev-wacom. Also enable a handle_data callback (currently empty), handle_reset (currently sets the device mode to HID instead of DJ). This is incomplete, the handle_data callback must contain something. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: get interval from descriptorPeter Wu1-2/+21
It looks very ugly, perhaps a helper function should moved to desc.c? Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16unifying: hook up usbdump with handle_controlPeter Wu1-6/+30
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16Initial usbdump helperPeter Wu3-0/+430
USB packets are captured in the pcap format using the Linux usbmon link-layer type. Right now, this only works with handle_ctrl. Data packets (isochronous, bulk and interrupt) are not (fully) implemented yet. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16unifying: WIP for Logitech Unifying Receiver emulationPeter Wu3-0/+670
Based on hw/usb/dev-wacom.c
2014-03-15Merge remote-tracking branch 'remotes/rth/tcg-aarch-6-2' into stagingPeter Maydell2-255/+594
* remotes/rth/tcg-aarch-6-2: tcg-aarch64: Introduce tcg_out_insn_3405 tcg-aarch64: Support div, rem tcg-aarch64: Support muluh, mulsh tcg-aarch64: Support add2, sub2 tcg-aarch64: Support deposit tcg-aarch64: Use tcg_out_insn for setcond tcg-aarch64: Support movcond tcg-aarch64: Support andc, orc, eqv, not, neg tcg-aarch64: Handle constant operands to and, or, xor tcg-aarch64: Handle constant operands to add, sub, and compare tcg-aarch64: Implement mov with tcg_out_insn tcg-aarch64: Introduce tcg_out_insn_3401 tcg-aarch64: Convert shift insns to tcg_out_insn tcg-aarch64: Introduce tcg_out_insn Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-03-14Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into ↵Peter Maydell11-22/+622
staging Block pull request # gpg: Signature made Fri 14 Mar 2014 16:12:14 GMT using RSA key ID 81AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/block-pull-request: qemu-iotests: remove 085 and 087 from 'quick' group qemu-iotests: add 083 NBD client disconnect tests tests: add nbd-fault-injector.py utility nbd: close socket if connection breaks block: Explicitly specify 'unsigned long long' for VHDX 64-bit constants blockdev: Refuse to open encrypted image unless paused Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-03-14Merge remote-tracking branch 'remotes/bonzini/scsi-next' into stagingPeter Maydell5-4/+38
* remotes/bonzini/scsi-next: virtio-scsi: actually honor sense_size from configuration space scsi: Fix migration of scsi sense data spapr-vscsi: fix CRQ status Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-03-14tcg-aarch64: Introduce tcg_out_insn_3405Richard Henderson1-21/+27
Cleaning up the implementation of tcg_out_movi at the same time. Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com> Tested-by: Claudio Fontana <claudio.fontana@huawei.com>
2014-03-14tcg-aarch64: Support div, remRichard Henderson2-13/+45
Clean up multiply at the same time. For remainder, generic code will produce mul+sub, whereas we can implement with msub. Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com> Tested-by: Claudio Fontana <claudio.fontana@huawei.com>
2014-03-14tcg-aarch64: Support muluh, mulshRichard Henderson2-2/+14
Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com> Tested-by: Claudio Fontana <claudio.fontana@huawei.com>
2014-03-14tcg-aarch64: Support add2, sub2Richard Henderson2-4/+80
Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com> Tested-by: Claudio Fontana <claudio.fontana@huawei.com>
2014-03-14tcg-aarch64: Support depositRichard Henderson2-21/+49
Also tidy the implementation of ubfm, sbfm, extr in order to share code. Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com> Tested-by: Claudio Fontana <claudio.fontana@huawei.com>
2014-03-14tcg-aarch64: Use tcg_out_insn for setcondRichard Henderson1-9/+3
Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com> Tested-by: Claudio Fontana <claudio.fontana@huawei.com>
2014-03-14tcg-aarch64: Support movcondRichard Henderson2-2/+36
Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com> Tested-by: Claudio Fontana <claudio.fontana@huawei.com>
2014-03-14tcg-aarch64: Support andc, orc, eqv, not, negRichard Henderson2-10/+67
Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com> Tested-by: Claudio Fontana <claudio.fontana@huawei.com>
2014-03-14tcg-aarch64: Handle constant operands to and, or, xorRichard Henderson1-49/+107
Handle a simplified set of logical immediates for the moment. The way gcc and binutils do it, with 52k worth of tables, and a binary search depth of log2(5334) = 13, seems slow for the most common cases. Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com> Tested-by: Claudio Fontana <claudio.fontana@huawei.com>
2014-03-14tcg-aarch64: Handle constant operands to add, sub, and compareRichard Henderson1-22/+78
Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com> Tested-by: Claudio Fontana <claudio.fontana@huawei.com>
2014-03-14tcg-aarch64: Implement mov with tcg_out_insnRichard Henderson1-15/+9
Avoid the magic numbers in the current implementation. Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com> Tested-by: Claudio Fontana <claudio.fontana@huawei.com>
2014-03-14tcg-aarch64: Introduce tcg_out_insn_3401Richard Henderson1-46/+26
This merges the implementation of tcg_out_addi and tcg_out_subi. Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com> Tested-by: Claudio Fontana <claudio.fontana@huawei.com>
2014-03-14tcg-aarch64: Convert shift insns to tcg_out_insnRichard Henderson1-31/+21
Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com> Tested-by: Claudio Fontana <claudio.fontana@huawei.com>
2014-03-14tcg-aarch64: Introduce tcg_out_insnRichard Henderson1-36/+58
Converting the add/sub (3.5.2) and logical shifted (3.5.10) instruction groups to the new scheme. Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com> Tested-by: Claudio Fontana <claudio.fontana@huawei.com>
2014-03-14qemu-iotests: remove 085 and 087 from 'quick' groupStefan Hajnoczi1-2/+2
The 'quick' group in qemu-iotests are not allowed to run QEMU since we don't know which targets are available. In other words, they may only use qemu-img, qemu-io, and qemu-nbd. Drop 085 and 087 from the 'quick' group since they run QEMU. This makes "make check-block" pass again. Reported-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-03-14qemu-iotests: add 083 NBD client disconnect testsStefan Hajnoczi3-0/+293
This new test case uses nbd-fault-injector.py to simulate broken TCP connections at each stage in the NBD protocol. This way we can exercise block/nbd-client.c's socket error handling code paths. In particular, this serves as a regression test to make sure nbd-client.c doesn't cause an infinite loop by leaving its nbd_receive_reply() fd handler registered after the connection has been closed. This bug was fixed in an earlier patch. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-03-14tests: add nbd-fault-injector.py utilityStefan Hajnoczi1-0/+264
The nbd-fault-injector.py script is a special kind of NBD server. It throws away all writes and produces zeroes for reads. Given a list of fault injection rules, it can simulate NBD protocol errors and is useful for testing NBD client error handling code paths. See the patch for documentation. This scripts is modelled after Kevin Wolf <kwolf@redhat.com>'s blkdebug block driver. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-03-14nbd: close socket if connection breaksStefan Hajnoczi1-15/+18
nbd_receive_reply() is called by the event loop whenever data is available or the socket has been closed by the remote side. This patch closes the socket when an error occurs to prevent the nbd_receive_reply() handler from being called indefinitely after the connection has failed. Note that we were already correctly returning EIO for pending requests but leaving the nbd_receive_reply() handler registered resulted in high CPU consumption and a flood of error messages. Reuse nbd_teardown_connection() to close the socket. Reported-by: Zhifeng Cai <bluewindow@h3c.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-03-14block: Explicitly specify 'unsigned long long' for VHDX 64-bit constantsJeff Cody1-3/+3
On 32-bit hosts, some compilers will warn on too large integer constants for constants that are 64-bit in length. Explicitly put a 'ULL' suffix on those defines. Reported-by: Alexander Graf <agraf@suse.de> Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-03-14blockdev: Refuse to open encrypted image unless pausedMarkus Armbruster5-2/+42
Opening an encrypted image takes an additional step: setting the key. Between open and the key set, the image must not be used. We have some protection against accidental use in place: you can't unpause a guest while we're missing keys. You can, however, hot-plug block devices lacking keys into a running guest just fine, or insert media lacking keys. In the latter case, notifying the guest of the insert is delayed until the key is set, which may suffice to protect at least some guests in common usage. This patch makes the protection apply in more cases, in a rather heavy-handed way: it doesn't let you open encrypted images unless we're in a paused state. It doesn't extend the protection to users other than the guest (block jobs?). Use of runstate_check() from block.c is disgusting. Best I can do right now. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-03-14virtio-scsi: actually honor sense_size from configuration spacePaolo Bonzini1-1/+3
We were always truncating the sense size to 96 bytes. Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-03-14scsi: Fix migration of scsi sense dataFam Zheng3-1/+33
c5f52875 changed the size of sense array in vmstate_scsi_device by mistake. This patch restores the old size, and add a subsection for the remaining part of the buffer size. So that migration is not broken. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-03-14spapr-vscsi: fix CRQ statusAlexey Kardashevskiy1-2/+2
Normally VIOSRP_OK (0) means success and non-zero value means error except VIOSRP_OK2 (0x99) which is another success code by weird accident. This uses 0 as success code always as some guests do not cope with the 0x99 value well. The existing linux driver checks for both VIOSRP_OK and VIOSRP_OK2 since 2.6.32. This returns non-zero code (VIOSRP_ADAPTER_FAIL == 0x10) on errors which can only happen if DMA write failed. Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-03-13Update version for v2.0-rc0v2.0.0-rc0Anthony Liguori1-1/+1
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2014-03-13Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-2.0' ↵Peter Maydell7-29/+39
into staging QOM/QTest infrastructure fixes * QOM cast fix for virtserialport and regression test * QTest error handling fix * QTest output cleanup # gpg: Signature made Thu 13 Mar 2014 20:43:34 GMT using RSA key ID 3E7E013F # gpg: Good signature from "Andreas Färber <afaerber@suse.de>" # gpg: aka "Andreas Färber <afaerber@suse.com>" * remotes/afaerber/tags/qom-devices-for-2.0: main-loop: Suppress "I/O thread spun" warnings for qtest qtest: Fix crash if SIGABRT during qtest_init() virtio-console-test: Test virtserialport as well virtio-console: Fix VIRTIO_CONSOLE() cast macro Signed-off-by: Peter Maydell <peter.maydell@linaro.org>