[pve-devel] [PATCH v4 manager 4/4] usb: Enable USB3 for Spice USB passthrough

Aaron Lauterer a.lauterer at proxmox.com
Wed Sep 11 14:43:34 CEST 2019


Instead of having two times the check if the USB3 setting needs to be
added to the config string it is now checked at one place only.

If USB3 is checked for a non USB3 device it will be attached to the USB2
root hub of the xhci controller.

Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
---
 www/manager6/qemu/USBEdit.js | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/www/manager6/qemu/USBEdit.js b/www/manager6/qemu/USBEdit.js
index 8fc95c99..776908a2 100644
--- a/www/manager6/qemu/USBEdit.js
+++ b/www/manager6/qemu/USBEdit.js
@@ -19,7 +19,7 @@ Ext.define('PVE.qemu.USBInputPanel', {
 		    } else if(field.inputValue === 'port') {
 			portfield.setDisabled(!newValue);
 		    } else if(field.inputValue === 'spice') {
-			usb3field.setDisabled(newValue);
+			usb3field.setDisabled(!newValue);
 		    }
 		}
 	    },
@@ -66,14 +66,15 @@ Ext.define('PVE.qemu.USBInputPanel', {
 	    case 'hostdevice':
 	    case 'port':
 		val = me.down('pveUSBSelector[name=' + type + ']').getUSBValue();
-		if (!/usb3/.test(val) && me.down('field[name=usb3]').getValue() === true) {
-		    val += ',usb3=1';
-		}
 		break;
 	    default:
 		throw "invalid type selected";
 	}
 
+	if (values.usb3) {
+	    delete values.usb3;
+	    val += ',usb3=1';
+	}
 	values[me.confid] = val;
 	return values;
     },
@@ -131,7 +132,7 @@ Ext.define('PVE.qemu.USBInputPanel', {
 		{
 		    xtype: 'checkbox',
 		    name: 'usb3',
-		    submitValue: false,
+		    inputValue: true,
 		    reference: 'usb3',
 		    fieldLabel: gettext('Use USB3')
 		}
-- 
2.20.1





More information about the pve-devel mailing list