[pve-devel] [PATCH manager 1/2] ui: vm/usbedit: simplify USB3 handling

Aaron Lauterer a.lauterer at proxmox.com
Thu Sep 26 15:03:17 CEST 2019


Enable USB3 by default. There are no restrictions anymore that the speed
of the dev must match the USB3 speed. The xhci controller can deal with
USB 2 and 1 devices. USB3 devices can be plugged in a USB2 (ehci)
controller.

When using a USB device for Spice passthrough my tests showed that USB2
devices connecting to the xhci controller work but a USB3 device passed
via Spice cannot connect to an ehci controller (no USB3 enabled).

qemu-server 6.0-9 supports USB3 also for Spice USB passthrough. See
commit 733234b.

All this means we can get rid of the separate handling of USB3 and non
USB3 devices and leave the decision to the user if USB3 should be
enabled or not.

Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
---

I don't want to call this v2 as we do things very differently than in
the previous patch [0] that dealt with this.

[0]: https://pve.proxmox.com/pipermail/pve-devel/2019-September/039122.html

 www/manager6/qemu/USBEdit.js | 27 +--------------------------
 1 file changed, 1 insertion(+), 26 deletions(-)

diff --git a/www/manager6/qemu/USBEdit.js b/www/manager6/qemu/USBEdit.js
index f41c3d21..ed792617 100644
--- a/www/manager6/qemu/USBEdit.js
+++ b/www/manager6/qemu/USBEdit.js
@@ -9,32 +9,6 @@ Ext.define('PVE.qemu.USBInputPanel', {
 	data: {}
     },
 
-    controller: {
-	xclass: 'Ext.app.ViewController',
-
-	control: {
-	    'pveUSBSelector': {
-		change: function(field, newValue, oldValue) {
-		    var usb3field = this.lookupReference('usb3');
-		    var usbval = field.getUSBValue();
-		    var dev_is_usb3 = /usb3=1/.test(usbval);
-
-		    if (dev_is_usb3) {
-			usb3field.savedVal = usb3field.getValue();
-			usb3field.setValue(true);
-		    } else {
-			if (usb3field.savedVal !== undefined) {
-			    usb3field.setValue(usb3field.savedVal);
-			} else {
-			    usb3field.setValue(usb3field.originalValue);
-			}
-			usb3field.setDisabled(false);
-		    }
-		}
-	    }
-	}
-    },
-
     setVMConfig: function(vmconfig) {
 	var me = this;
 	me.vmconfig = vmconfig;
@@ -128,6 +102,7 @@ Ext.define('PVE.qemu.USBInputPanel', {
 		    xtype: 'checkbox',
 		    name: 'usb3',
 		    inputValue: true,
+		    checked: true,
 		    reference: 'usb3',
 		    fieldLabel: gettext('Use USB3')
 		}
-- 
2.20.1





More information about the pve-devel mailing list