summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-03-30 09:53:54 +0200
committerGerd Hoffmann <kraxel@redhat.com>2012-04-17 10:23:28 +0200
commit714f9db06c209fd42d67e6dffd4f7fd932b51b65 (patch)
treeb1b8580f71f4ae4af1408d6ed055b2bd094a740b
parent8e24283b2687e1d58d5f6a4872198c29e8a45d00 (diff)
downloadqemu-714f9db06c209fd42d67e6dffd4f7fd932b51b65.tar.gz
qemu-714f9db06c209fd42d67e6dffd4f7fd932b51b65.tar.bz2
qemu-714f9db06c209fd42d67e6dffd4f7fd932b51b65.zip
usb-redir: Notify our peer when we reject a device due to a speed mismatch
Also cleanup (reset) our device state when we reject a device due to a speed mismatch. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r--hw/usb/redirect.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 4288324110..94ab4632ca 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -836,7 +836,13 @@ static void usbredir_do_attach(void *opaque)
{
USBRedirDevice *dev = opaque;
- usb_device_attach(&dev->dev);
+ if (usb_device_attach(&dev->dev) != 0) {
+ usbredir_device_disconnect(dev);
+ if (usbredirparser_peer_has_cap(dev->parser, usb_redir_cap_filter)) {
+ usbredirparser_send_filter_reject(dev->parser);
+ usbredirparser_do_write(dev->parser);
+ }
+ }
}
/*