Permalink
Browse files

usb-redir: Notify our peer when we reject a device due to a speed mis…

…match

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>
  • Loading branch information...
1 parent 8e24283 commit 714f9db06c209fd42d67e6dffd4f7fd932b51b65 @jwrdegoede jwrdegoede committed with kraxel Mar 30, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 hw/usb/redirect.c
View
@@ -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);
+ }
+ }
}
/*

0 comments on commit 714f9db

Please sign in to comment.