public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Hrdlicka <s.hrdlicka@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH pve-manager 1/2] fix #1981: get next free disk id on change of bus/device
Date: Wed, 28 Sep 2022 11:37:55 +0200	[thread overview]
Message-ID: <20220928093756.3275614-2-s.hrdlicka@proxmox.com> (raw)
In-Reply-To: <20220928093756.3275614-1-s.hrdlicka@proxmox.com>

Signed-off-by: Stefan Hrdlicka <s.hrdlicka@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 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/www/manager6/form/ControllerSelector.js b/www/manager6/form/ControllerSelector.js
index d84c49d6..6daede95 100644
--- a/www/manager6/form/ControllerSelector.js
+++ b/www/manager6/form/ControllerSelector.js
@@ -12,7 +12,9 @@ Ext.define('PVE.form.ControllerSelector', {
 	let freeId = PVE.Utils.nextFreeDisk(controllers, me.vmconfig);
 
 	if (freeId !== undefined) {
-	    busField.setValue(freeId.controller);
+	    if (busField !== undefined) {
+		busField.setValue(freeId.controller);
+	    }
 	    deviceIDField.setValue(freeId.id);
 	}
     },
@@ -83,6 +85,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





  reply	other threads:[~2022-09-28  9:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28  9:37 [pve-devel] [PATCH pve-manager 0/2] " Stefan Hrdlicka
2022-09-28  9:37 ` Stefan Hrdlicka [this message]
2022-09-28 10:28   ` [pve-devel] [PATCH pve-manager 1/2] " Matthias Heiserer
2022-09-28  9:37 ` [pve-devel] [PATCH pve-manager 2/2] cleanup: style fix Stefan Hrdlicka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220928093756.3275614-2-s.hrdlicka@proxmox.com \
    --to=s.hrdlicka@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal