[Spice-devel] [PATCH] usbredirhost: host should not be marked as claimed on failure

Qiu Wenbo qiuwenbo at kylinos.com.cn
Mon May 7 07:47:50 UTC 2018


You can redirect a USB device which is already redirected to another
virtual machine on the second attempt.

Signed-off-by: Qiu Wenbo <qiuwenbo at kylinos.com.cn>
---
 usbredirhost/usbredirhost.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/usbredirhost/usbredirhost.c b/usbredirhost/usbredirhost.c
index 3666227..e96d980 100644
--- a/usbredirhost/usbredirhost.c
+++ b/usbredirhost/usbredirhost.c
@@ -557,6 +557,7 @@ static int usbredirhost_claim(struct usbredirhost *host, int initial_claim)
                 ERROR("could not claim interface %d (configuration %d): %s",
                       n, host->config->bConfigurationValue,
                       libusb_error_name(r));
+            host->claimed = 0;
             return libusb_status_or_error_to_redir_status(host, r);
         }
     }
-- 
2.17.0





More information about the Spice-devel mailing list