[pve-devel] [PATCH manager] HDEdit: warn when IO threads are enabled with incompatible controller

Stefan Reiter s.reiter at proxmox.com
Thu Apr 16 17:15:29 CEST 2020


The only warning displayed before was in the "VM Start" task log, rather
hidden. In the wizard we already auto-selected the correct controller, but
not when modifying a disk on an existing VM.

Don't break existing behaviour (to allow users to disable IO threads for
VMs that currently have it set but an incompatible controller), but do warn
them that the setting will be ignored.

Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
---
 www/manager6/qemu/HDEdit.js | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/www/manager6/qemu/HDEdit.js b/www/manager6/qemu/HDEdit.js
index fd890600..d50fe077 100644
--- a/www/manager6/qemu/HDEdit.js
+++ b/www/manager6/qemu/HDEdit.js
@@ -35,6 +35,19 @@ Ext.define('PVE.qemu.HDInputPanel', {
 	    this.lookup('scsiController').setVisible(value.match(/^scsi/));
 	},
 
+	updateIOThreadHint: function() {
+	    let me = this;
+	    let view = me.getView();
+	    if (view.insideWizard) {
+		// we autoselect a compatible controller in the wizard
+		return;
+	    }
+
+	    let visible = view.drive.interface === 'scsi' &&
+		view.vmconfig.scsihw !== 'virtio-scsi-single';
+	    me.lookupReference('iothreadHint').setVisible(visible);
+	},
+
 	control: {
 	    'field[name=controller]': {
 		change: 'onControllerChange',
@@ -42,6 +55,12 @@ Ext.define('PVE.qemu.HDInputPanel', {
 	    },
 	    'field[name=iothread]' : {
 		change: function(f, value) {
+		    if (value) {
+			this.updateIOThreadHint();
+		    } else {
+			this.lookupReference('iothreadHint').setVisible(false);
+		    }
+
 		    if (!this.getView().insideWizard) {
 			return;
 		    }
@@ -285,7 +304,14 @@ Ext.define('PVE.qemu.HDInputPanel', {
 		fieldLabel: gettext('Write limit') + ' (ops/s)',
 		labelWidth: labelWidth,
 		emptyText: gettext('unlimited')
-	    }
+	    },
+	    {
+		xtype: 'displayfield',
+		userCls: 'pmx-hint',
+		reference: 'iothreadHint',
+		value: gettext("IO threads will only be used with VirtIO Block disks or when using the 'VirtIO SCSI single' controller model!"),
+		hidden: true,
+	    },
 	);
 
 	me.advancedColumn2.push(
-- 
2.26.1





More information about the pve-devel mailing list