Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 714f9db06c209fd42d67e6dffd4f7fd932b51b65 1 parent 8e24283
Hans de Goede jwrdegoede authored kraxel committed
Showing with 7 additions and 1 deletion.
  1. +7 −1 hw/usb/redirect.c
8 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);
+ }
+ }
}
/*
Please sign in to comment.
Something went wrong with that request. Please try again.