xhci: remove XHCIRing->base (unused)

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ehci_free_packet: Discard finished packets when the queue is halted

With pipelining it is possible to encounter a finished packet when cleaning
the queue due to a halt. This happens when a non stall error happens while
talking to a real device. In this case the queue on the usb-host side will
continue processing packets, and we can have completed packets waiting in
the queue after an error condition packet causing a halt.

There are 2 reasons to discard the completed packets at this point, rather
then trying to writing them back to the guest:

1) The guest expect to be able to cancel and/or change packets after the
packet with the error without doing an unlink, so writing them back may
confuse the guest.

2) Since the queue does not advance when halted, the writing back of these
packets will fail anyways since p->qtdaddr != q->qtdaddr, so the
ehci_verify_qtd call in ehci_writeback_async_complete_packet will fail.

Note that 2) means that then only functional change this patch introduces
is the printing of a warning when this scenario happens.

Note that discarding these packets means that the guest driver and the device
will get out of sync! This is unfortunate, but should not be a problem since
with a non stall error (iow an io-error) the 2 are out of sync already anyways.
Still this patch adds a warning to signal this happening.

Note that sofar this has only been seen with a DVB-T receiver, which gives
of a MPEG-2 stream, which allows for recovering from lost packets, see:
https://bugzilla.redhat.com/show_bug.cgi?id=890320

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: better speed mismatch error reporting

Report the supported speeds for device and port in the error message.
Also add the speeds to the tracepoint.  And while being at it drop
the redundant error message in usb_desc_attach, usb_device_attach will
report the error anyway.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-host: raise libusbx minimum version to 1.0.13

Allows to remove one FIXME.  Makes LIBUSB_LOG_LEVEL_WARNING build errors
go away.  And starting with that version libusb has a LIBUSBX_API_VERSION
define which allows to easily #ifdef version dependencies should that
need arrive in the future.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Merge remote-tracking branch 'kraxel/usb.81' into staging

# By Gerd Hoffmann (3) and Hans de Goede (1)
# Via Gerd Hoffmann
* kraxel/usb.81:
  usb-host: raise libusbx minimum version to 1.0.13
  usb: better speed mismatch error reporting
  ehci_free_packet: Discard finished packets when the queue is halted
  xhci: remove XHCIRing->base (unused)

Message-id: 1366705929-11251-1-git-send-email-kraxel@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ui/gtk: Use gtk_widget_get_window() to support both gtk2 and gtk3

This fixes build with gtk+-3.0.

Signed-off-by: Ozan Çağlayan <ozancag@gmail.com>
Message-id: 1366711402-1750-1-git-send-email-ozancag@gmail.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ui/gtk: Add Turkish translations

Signed-off-by: Ozan Çağlayan <ozancag@gmail.com>
Message-id: 1366711456-1935-1-git-send-email-ozancag@gmail.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-9p: add the virtio-9p device.

Create virtio-9p-device which extends virtio-device, so it can be connected on
virtio-bus.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Message-id: 1366708123-19626-2-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-9p-pci: switch to the new API.

Here the virtio-9p-pci is modified for the new API. The device
virtio-9p-pci extends virtio-pci. It creates and connects a
virtio-9p-device during the init. The properties are not changed.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Message-id: 1366708123-19626-3-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-9p: cleanup: init function.

This remove old init function as it is no longer needed.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Message-id: 1366708123-19626-4-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-9p: cleanup: QOM casts.

As the virtio-9p-pci is switched to the new API, we can use QOM casts.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Message-id: 1366708123-19626-5-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Move TPM passthrough specific command line options to backend structure

Move the TPM passthrough specific command line options to the passthrough
backend implementation and attach them to the backend's interface structure.

Add code to tpm.c for validating the TPM command line options.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Corey Bryan <coreyb@linux.vnet.ibm.com>
Message-id: 1366641699-21420-1-git-send-email-stefanb@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
libcacard: correct T0 historical bytes size

The VCARD_ATR_PREFIX macro adds a prefix of 6 characters only.

pcsc_scan was complaining before the patch:

+ Historical bytes: 56 43 41 52 44 5F 4E 53 53
 ERROR! ATR is truncated: 2 byte(s) is/are missing

Signed-off-by: Marc-André Lureau <mlureau@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
ccid-card-emul: do not crash if backend is not provided

Program received signal SIGSEGV, Segmentation fault.
__strcmp_sse42 () at ../sysdeps/x86_64/multiarch/strcmp-sse42.S:164
164               movdqu        (%rsi), %xmm2
(gdb) bt
    at /home/elmarco/320g/src/qemu/hw/ccid-card-emulated.c:477
    at /home/elmarco/320g/src/qemu/hw/ccid-card-emulated.c:503

Signed-off-by: Marc-André Lureau <mlureau@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
ccid: make backend_enum_table "static const" and adjust users

Signed-off-by: Jim Meyering <meyering@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
ccid: declare DEFAULT_ATR table to be "static const"

Signed-off-by: Jim Meyering <meyering@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
libcacard: use system config directory for nss db on win32

It's a bit nicer to look for default database under
CSIDL_COMMON_APPDATA\pki\nss rather that /etc/pki/nss.

Signed-off-by: Marc-André Lureau <mlureau@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
util: move socket_init() to osdep.c

vscclient needs to call socket_init() for portability.
Moving to osdep.c since it has no internal dependency.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
build-sys: must link with -fstack-protector

It is needed to give that flag to the linker as well, but latest
libtool 2.4.2 still swallows that argument, so let's pass it with
libtool -Wc argument.

qemu-1.4.0/stubs/arch-query-cpu-def.c:6: undefined reference to `__stack_chk_guard'

Signed-off-by: Marc-André Lureau <mlureau@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
libcacard: fix mingw64 cross-compilation

Compile and link with version.lo

Signed-off-by: Marc-André Lureau <mlureau@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>