public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH pve-manager] ui: qemu: HDEdit: add iothread-vq-mapping UI controls
@ 2026-06-05 15:15 Dominik Budzowski
  0 siblings, 0 replies; only message in thread
From: Dominik Budzowski @ 2026-06-05 15:15 UTC (permalink / raw)
  To: pve-devel; +Cc: Dominik Budzowski

Add a 'VQ Mapping' checkbox and 'VQ count' integer field (2-16) to the
hard disk edit panel. When VQ Mapping is enabled, the standard IO thread
checkbox is disabled (they are mutually exclusive), and the selected count
is stored as iothread_vq_mapping on the drive config.

Loading an existing drive with iothread_vq_mapping set pre-selects the
VQ Mapping checkbox and restores the count value.

Resolves: https://bugzilla.proxmox.com/show_bug.cgi?id=6350
Signed-off-by: Dominik Budzowski <dominik@budzowski.pl>
---
 www/manager6/qemu/HDEdit.js | 59 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 58 insertions(+), 1 deletion(-)

diff --git a/www/manager6/qemu/HDEdit.js b/www/manager6/qemu/HDEdit.js
index 1bb2bfd..7f52f5c 100644
--- a/www/manager6/qemu/HDEdit.js
+++ b/www/manager6/qemu/HDEdit.js
@@ -92,7 +92,11 @@ Ext.define('PVE.qemu.HDInputPanel', {
         PVE.Utils.propertyStringSet(me.drive, values.noreplicate, 'replicate', 'no');
         PVE.Utils.propertyStringSet(me.drive, values.discard, 'discard', 'on');
         PVE.Utils.propertyStringSet(me.drive, values.ssd, 'ssd', 'on');
-        PVE.Utils.propertyStringSet(me.drive, values.iothread, 'iothread', 'on');
+        let vqCb = me.down('[name=vq_mapping_enabled]');
+        let vqField = me.down('[name=iothread_vq_mapping]');
+        let vqCount = (vqCb && !vqCb.disabled && vqCb.getValue() && vqField) ? vqField.getValue() : undefined;
+        PVE.Utils.propertyStringSet(me.drive, vqCount ? undefined : values.iothread, 'iothread', 'on');
+        PVE.Utils.propertyStringSet(me.drive, vqCount || undefined, 'iothread_vq_mapping');
         PVE.Utils.propertyStringSet(me.drive, values.readOnly, 'ro', 'on');
         PVE.Utils.propertyStringSet(me.drive, values.cache, 'cache');
         PVE.Utils.propertyStringSet(me.drive, values.aio, 'aio');
@@ -154,6 +158,8 @@ Ext.define('PVE.qemu.HDInputPanel', {
         values.discard = drive.discard === 'on';
         values.ssd = PVE.Parser.parseBoolean(drive.ssd);
         values.iothread = PVE.Parser.parseBoolean(drive.iothread);
+        values.vq_mapping_enabled = !!drive.iothread_vq_mapping;
+        values.iothread_vq_mapping = drive.iothread_vq_mapping ? parseInt(drive.iothread_vq_mapping, 10) : 4;
         values.readOnly = PVE.Parser.parseBoolean(drive.ro);
         values.aio = drive.aio || '__default__';
 
@@ -332,6 +338,57 @@ Ext.define('PVE.qemu.HDInputPanel', {
                         : {
                               disabled: '{!isVirtIO && !isSCSI}',
                           },
+                listeners: {
+                    change: function(cb, val) {
+                        let win = cb.up('window');
+                        let vqCb = win.down('[name=vq_mapping_enabled]');
+                        let countField = win.down('[name=iothread_vq_mapping]');
+                        if (vqCb) {
+                            vqCb.setDisabled(!!val);
+                            if (val && vqCb.getValue()) {
+                                vqCb.setValue(false);
+                                if (countField) countField.setDisabled(true);
+                            }
+                        }
+                    },
+                },
+            },
+            {
+                xtype: 'proxmoxcheckbox',
+                name: 'vq_mapping_enabled',
+                fieldLabel: 'VQ Mapping',
+                submitValue: false,
+                clearOnDisable: true,
+                bind: {
+                    disabled: '{!isVirtIO && !isSCSI}',
+                },
+                listeners: {
+                    change: function(cb, val) {
+                        let win = cb.up('window');
+                        let countField = win.down('[name=iothread_vq_mapping]');
+                        if (countField) {
+                            countField.setDisabled(!val);
+                            if (!val) countField.setValue(4);
+                        }
+                        let iothreadCb = win.down('[name=iothread]');
+                        if (iothreadCb) {
+                            iothreadCb.setDisabled(!!val);
+                            if (val && iothreadCb.getValue()) {
+                                iothreadCb.setValue(false);
+                            }
+                        }
+                    },
+                },
+            },
+            {
+                xtype: 'proxmoxintegerfield',
+                name: 'iothread_vq_mapping',
+                fieldLabel: 'VQ count',
+                minValue: 2,
+                maxValue: 16,
+                value: 4,
+                disabled: true,
+                allowBlank: false,
             },
         );
 
-- 
2.47.3




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-05 19:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-05 15:15 [PATCH pve-manager] ui: qemu: HDEdit: add iothread-vq-mapping UI controls Dominik Budzowski

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