After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 773924 - An option to allow USB redirection of mice/keyboard
An option to allow USB redirection of mice/keyboard
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: --
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-11-03 23:27 UTC by Thomas Andersen
Modified: 2016-11-05 11:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add environment variable to allow redirecting all USB devices (1.11 KB, patch)
2016-11-03 23:29 UTC, Thomas Andersen
none Details | Review
Add environment variable to allow redirecting all USB devices v2 (1.10 KB, patch)
2016-11-04 16:36 UTC, Thomas Andersen
none Details | Review
Add environment variable to allow redirecting all USB devices v3 (1.10 KB, patch)
2016-11-04 20:38 UTC, Thomas Andersen
committed Details | Review

Description Thomas Andersen 2016-11-03 23:27:01 UTC
I agree that it makes sense for most use cases to not allow redirecting USB mice and keyboards. For working on libratbag though it would be very handy to be able to do that.
Comment 1 Thomas Andersen 2016-11-03 23:29:41 UTC
Created attachment 339088 [details] [review]
Add environment variable to allow redirecting all USB devices

This patch adds an environment variable "BOXES_ALLOW_ALL_USB_DEVICES" which if set will allow all USB devices to be redirected.
Comment 2 Zeeshan Ali 2016-11-04 09:07:51 UTC
Review of attachment 339088 [details] [review]:

Thanks for providing a patch. Always appreciated. Could be slight improved though (all nitpicks):

* shortlog should ideally be under 50 chars (at least close to it) and here it's possible to easily achieve that.
* Start phrases/sentences with capital: add -> Add
* attaching -> redirecting
* "all USB devices" -> "redirecting all USB devices".

::: src/spice-display.vala
@@ +423,3 @@
         var devs = manager.get_devices ();
 
+        if (Environment.get_variable ("BOXES_ALLOW_ALL_USB_DEVICES") != null)

I'd prefer "BOXES_USB_REDIR_ALL"
Comment 3 Thomas Andersen 2016-11-04 16:36:18 UTC
Created attachment 339128 [details] [review]
Add environment variable to allow redirecting all USB devices v2

Updated for comments. Commit message is now 55 long. It was the best I could come up with. I can drop the "spice-display:" prefix if you want it shorter?
Comment 4 Zeeshan Ali 2016-11-04 19:36:10 UTC
Review of attachment 339128 [details] [review]:

Looks good. For shortening the log further, just drop the 'USB' since that part is not most critical and mentioned in the details. While you're at it, I'd suggest 'mice/kbd' -> 'mice & kbd' as well but up to you.
Comment 5 Thomas Andersen 2016-11-04 20:38:40 UTC
Created attachment 339140 [details] [review]
Add environment variable to allow redirecting all USB devices v3

Updated commit message as suggested.

My commit rights have expired due to inactivity. Can I ask you to commit it for me?
Comment 6 Felipe Borges 2016-11-05 11:50:17 UTC
Attachment 339140 [details] pushed as dfff504 - spice-display: Add env var for redirecting mice & kbd