[pve-devel] [PATCH manager 1/3] create: clear iothread on disable

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Aug 23 09:41:00 CEST 2017


A user may set the `iothread` option and then change the bus type to
something which does not support it (sata, ide), while we disable
it the previously set value remains, which is confusing.
An user could think he coulkd trick the Wizard into using iothreads
for SATA/IDE but we just ignore the value in this case.

Set iothread to false in the case it gets disabled.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 www/manager6/qemu/HDEdit.js | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/www/manager6/qemu/HDEdit.js b/www/manager6/qemu/HDEdit.js
index 6b19b7a5..c97f530c 100644
--- a/www/manager6/qemu/HDEdit.js
+++ b/www/manager6/qemu/HDEdit.js
@@ -16,8 +16,11 @@ Ext.define('PVE.qemu.HDInputPanel', {
 	xclass: 'Ext.app.ViewController',
 
 	onControllerChange: function(field) {
-	    var value = field.getValue();
-	    this.lookup('iothread').setDisabled(!value.match(/^(virtio|scsi)/));
+	    var allowIOthread = field.getValue().match(/^(virtio|scsi)/);
+	    this.lookup('iothread').setDisabled(!allowIOthread);
+	    if (!allowIOthread) {
+		this.lookup('iothread').setValue(false);
+	    }
 	},
 
 	control: {
-- 
2.11.0




More information about the pve-devel mailing list