usb-redir: Fix crash on migration with no client connected

If no client is connected on the src side, then we won't receive a
parser during migrate, in this case usbredir_post_load() should be a nop,
rather then to try to derefefence the NULL dev->parser pointer.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 3713e1485e6eace7d48b9c790602cfd92c616e5f)
usb-redir: Add flow control support

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit c874ea97b9d0d079e9d65ef033b95afef0ed6532)
xhci: fix numintrs sanity checks

Make sure numintrs is a power of two, msi requires this.

https://bugzilla.redhat.com/show_bug.cgi?id=918035

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit c94a7c6979cafa7a71f32b35e0ff71ed00c61a89)
xhci: remove leftover debug printf

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 61803996def82a05d8634dd9087f1712d04863fc)
xhci: remove unimplemented printfs

Replace them with a tracepoint, so they don't spam stderr by default.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 0ab966cfcc7000baa2e7ef6df7771e73a2eb8a88)
xhci: zap unused name field

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 4b7b2afae773f00c785724261079ef211fd6021b)
usb-hub: limit chain length

USB supports up to 5 hubs chained.
Catch attempts to chain more.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit c24e4aac3bd7dd6591e26b77985e5d3915ecbe4b)
usb-hub: report status changes only once

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit a309ee6e0a256f690760abfba44fceaa52a7c2f3)
usb: update docs for bus name change

At some point the default usb bus name changed from 'usb.0' to
'usb-bus.0' (probably as part of the qom conversion).  Update
the usb documentation accordingly.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit f9618633a86cc74b33f178f05154d4edbc08c0fc)
usb-tablet: Don't claim wakeup capability for USB-2 version

Our ehci code does not implement wakeup support, so claiming support for
it with usb-tablet in USB-2 mode causes all tablet events to get lost.

http://bugzilla.redhat.com/show_bug.cgi?id=929068

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit aa1c9e971e80d25b92908dce3dec7c38b49480ea)
qga: add windows implementation for guest-get-time

Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
(cherry picked from commit 3f2a6087de291dc96a2c4975139da27649cf32ff)
qga: add windows implementation for guest-set-time

Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
(cherry picked from commit b8f954fea019801370954fe85c32df49edf6397d)
qga schema: mark optional GuestLogicalProcessor.can-offline with #optional

Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
(cherry picked from commit c964c9e0985e71527bac47c8351008c3dc18c1b8)
qga schema: document generic QERR_UNSUPPORTED

Part of the wording was shamelessly stolen from Michael Roth's email.

Suggested-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
(cherry picked from commit 9481ecd737b91d507baf347287c62efe6760784f)
qemu-ga: ga_get_fd_handle(): abort if fd_counter overflows

Today we reset fd_counter if it wraps, but it's better to abort()
instead, as fd_counter should never reach INT64_MAX.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>

*fixed typo: s/resonable/reasonable/

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
(cherry picked from commit ce7f7cc2715145eadf1ac45a5dae63f535fc8bbf)
qemu-char: really fix behavior on can_read = 0

I misread the glib manual, g_source_remove does not let you re-attach
the source later.  This behavior (called "blocking" the source in glib)
is present in glib's source code, but private and not available outside
glib; hence, we have to resort to re-creating the source every time.

In fact, g_source_remove and g_source_destroy are the same thing,
except g_source_destroy is O(1) while g_source_remove scans a potentially
very long list of GSources in the current main loop.  Ugh.  Better
use g_source_destroy explicitly, and leave "tags" to those dummies who
cannot track their pointers' lifetimes.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1365426195-12596-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 1e885b25275fb6763eb947b1e53b2d6911b967a8)
configure: Provide and use convenience error reporting function

Provide a convenience function for reporting an error and exiting,
and update various places in the configure script to use it.
This allows us to be a little more consistent about how format
our error messages and makes the calling code shorter.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1365419487-19867-2-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 76ad07a4938aac69cb12bfdf52c3bf612c85e4df)
configure: Don't fall back to gthread coroutine backend

The gthread coroutine backend is broken and does not produce a working
QEMU; it is only useful for some very limited debugging situations.
Clean up the backend selection logic in configure so that it now runs
"if on windows use windows; else prefer ucontext; else sigaltstack".

To do this we refactor the configure code to separate out "test
whether we have a working ucontext", "pick a default if user didn't
specify" and "validate that user didn't specify something invalid",
rather than having all three of these run together. We also simplify
the Makefile logic so it just links in the backend the configure
script selects.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1365419487-19867-3-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 7c2acc7062fe863cb71ff5849bb121deafe8df4b)