]> git.proxmox.com Git - pve-manager.git/commitdiff
GUI: HDEdit: check iothread by default and move it from advanced section
authorMatthias Heiserer <m.heiserer@proxmox.com>
Mon, 13 Jun 2022 13:54:22 +0000 (15:54 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 8 Nov 2022 16:50:38 +0000 (17:50 +0100)
Existing disks are not changed by this.
Especially in benchmarks, iothreads significantly improve IO performance.

Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
www/manager6/qemu/HDEdit.js

index 4e4d6aac2405006f06f3a92b8f87f85765d9185b..921bfe72d3575a764f9b2ab7663777dc2c66c9a1 100644 (file)
@@ -14,6 +14,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
        data: {
            isSCSI: false,
            isVirtIO: false,
+           isSCSISingle: false,
        },
     },
 
@@ -44,13 +45,10 @@ Ext.define('PVE.qemu.HDInputPanel', {
            'field[name=deviceid]': {
                change: 'fireIdChange',
            },
-           'field[name=iothread]': {
+           'field[name=scsiController]': {
                change: function(f, value) {
-                   if (!this.getView().insideWizard) {
-                       return;
-                   }
-                   var vmScsiType = value ? 'virtio-scsi-single': 'virtio-scsi-pci';
-                   this.lookupReference('scsiController').setValue(vmScsiType);
+                   let vm = this.getViewModel();
+                   vm.set('isSCSISingle', value === 'virtio-scsi-single');
                },
            },
        },
@@ -195,6 +193,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
            me.scsiController = Ext.create('Ext.form.field.Display', {
                fieldLabel: gettext('SCSI Controller'),
                reference: 'scsiController',
+               name: 'scsiController',
                bind: me.insideWizard ? {
                    value: '{current.scsihw}',
                    visible: '{isSCSI}',
@@ -251,25 +250,27 @@ Ext.define('PVE.qemu.HDInputPanel', {
                reference: 'discard',
                name: 'discard',
            },
-       );
-
-       advancedColumn1.push(
            {
                xtype: 'proxmoxcheckbox',
-               fieldLabel: gettext('SSD emulation'),
-               name: 'ssd',
+               name: 'iothread',
+               fieldLabel: 'IO thread',
                clearOnDisable: true,
                bind: {
-                   disabled: '{isVirtIO}',
+                   disabled: '{!isVirtIO && !isSCSI}',
+                   // Checkbox.setValue handles Arrays in a different way, therefore cast to bool
+                   value: '{!!isVirtIO || (isSCSI && isSCSISingle)}',
                },
            },
+       );
+
+       advancedColumn1.push(
            {
                xtype: 'proxmoxcheckbox',
-               name: 'iothread',
-               fieldLabel: 'IO thread',
+               fieldLabel: gettext('SSD emulation'),
+               name: 'ssd',
                clearOnDisable: true,
                bind: {
-                   disabled: '{!isVirtIO && !isSCSI}',
+                   disabled: '{isVirtIO}',
                },
            },
            {