[pve-devel] [PATCH V2 pve-manager 1/2] fix #1981: get next free disk id on change of bus/device

Stefan Hrdlicka s.hrdlicka at proxmox.com
Mon Oct 10 17:21:15 CEST 2022


Signed-off-by: Stefan Hrdlicka <s.hrdlicka at proxmox.com>
---
 FYI: When IDE already has 4 devices and the user tries to add another one,
 the number device number isn't changed since there isn't any space
 left.

 www/manager6/form/ControllerSelector.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/www/manager6/form/ControllerSelector.js b/www/manager6/form/ControllerSelector.js
index d84c49d6..8a52737d 100644
--- a/www/manager6/form/ControllerSelector.js
+++ b/www/manager6/form/ControllerSelector.js
@@ -12,7 +12,7 @@ Ext.define('PVE.form.ControllerSelector', {
 	let freeId = PVE.Utils.nextFreeDisk(controllers, me.vmconfig);
 
 	if (freeId !== undefined) {
-	    busField.setValue(freeId.controller);
+	    busField?.setValue(freeId.controller);
 	    deviceIDField.setValue(freeId.id);
 	}
     },
@@ -83,6 +83,7 @@ Ext.define('PVE.form.ControllerSelector', {
 				return;
 			    }
 			    let field = me.down('field[name=deviceid]');
+			    me.setToFree([value], undefined, field);
 			    field.setMaxValue(PVE.Utils.diskControllerMaxIDs[value] - 1);
 			    field.validate();
 			},
-- 
2.30.2






More information about the pve-devel mailing list