[pve-devel] [PATCH manager 1/2] ui: USBInputPanel: use correct maximum usb index

Dominik Csapak d.csapak at proxmox.com
Thu Nov 10 15:35:59 CET 2022


We already have that factored out in PVE.Utils, so use that.

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/qemu/USBEdit.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/www/manager6/qemu/USBEdit.js b/www/manager6/qemu/USBEdit.js
index a2204584a..4373f82c3 100644
--- a/www/manager6/qemu/USBEdit.js
+++ b/www/manager6/qemu/USBEdit.js
@@ -17,7 +17,7 @@ Ext.define('PVE.qemu.USBInputPanel', {
     onGetValues: function(values) {
 	var me = this;
 	if (!me.confid) {
-	    for (let i = 0; i < 6; i++) {
+	    for (let i = 0; i < PVE.Utils.hardware_counts.usb; i++) {
 		let id = 'usb' + i.toString();
 		if (!me.vmconfig[id]) {
 		    me.confid = id;
-- 
2.30.2






More information about the pve-devel mailing list