From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 2AF191FF17E for ; Thu, 13 Nov 2025 16:50:59 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6EA9421AF3; Thu, 13 Nov 2025 16:51:36 +0100 (CET) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Thu, 13 Nov 2025 16:51:08 +0100 Message-ID: <20251113155127.591195-3-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251113155127.591195-1-f.ebner@proxmox.com> References: <20251113155127.591195-1-f.ebner@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1763049064764 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.019 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH manager v2 2/3] close #5291: ui: qemu: memory edit: support disabling KSM for specific VMs X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Signed-off-by: Fiona Ebner --- www/manager6/qemu/HardwareView.js | 11 +++++++- www/manager6/qemu/MemoryEdit.js | 45 ++++++++++++++++++++++++++----- 2 files changed, 49 insertions(+), 7 deletions(-) diff --git a/www/manager6/qemu/HardwareView.js b/www/manager6/qemu/HardwareView.js index f1f715eb..cf5e2a0f 100644 --- a/www/manager6/qemu/HardwareView.js +++ b/www/manager6/qemu/HardwareView.js @@ -73,7 +73,7 @@ Ext.define('PVE.qemu.HardwareView', { defaultValue: '512', tdCls: 'pve-itype-icon-memory', group: 2, - multiKey: ['memory', 'balloon', 'shares'], + multiKey: ['memory', 'balloon', 'shares', 'allow-ksm'], renderer: function (value, metaData, record, ri, ci, store, pending) { var res = ''; @@ -92,6 +92,12 @@ Ext.define('PVE.qemu.HardwareView', { } else if (balloon === 0) { res += ' [balloon=0]'; } + + let allowKsm = me.getObjectValue('allow-ksm', undefined, pending); + if (allowKsm !== undefined) { + res += ' [allow-ksm=' + allowKsm + ']'; + } + return res; }, }, @@ -214,6 +220,9 @@ Ext.define('PVE.qemu.HardwareView', { numa: { visible: false, }, + 'allow-ksm': { + visible: false, + }, balloon: { visible: false, }, diff --git a/www/manager6/qemu/MemoryEdit.js b/www/manager6/qemu/MemoryEdit.js index 1fa2f7fa..ff4a7545 100644 --- a/www/manager6/qemu/MemoryEdit.js +++ b/www/manager6/qemu/MemoryEdit.js @@ -33,23 +33,39 @@ Ext.define('PVE.qemu.MemoryInputPanel', { }, onGetValues: function (values) { - var _me = this; + let res = {}; - var res = {}; + let deleteSet = new Set([]); + + // properties that can be passed as-is + let propagate = ['allow-ksm', 'memory']; + + propagate.forEach(function (prop) { + if (values.delete?.split(',').includes(prop)) { + deleteSet.add(prop); + } + if (prop in values) { + res[prop] = values[prop]; + } + }); - res.memory = values.memory; res.balloon = values.balloon; if (!values.ballooning) { res.balloon = 0; - res.delete = 'shares'; + deleteSet.add('shares'); } else if (values.memory === values.balloon) { delete res.balloon; - res.delete = 'balloon,shares'; + deleteSet.add('balloon'); + deleteSet.add('shares'); } else if (Ext.isDefined(values.shares) && values.shares !== '') { res.shares = values.shares; } else { - res.delete = 'shares'; + deleteSet.add('shares'); + } + + if (deleteSet.size > 0) { + res.delete = deleteSet.keys().toArray().join(','); } return res; @@ -133,6 +149,22 @@ Ext.define('PVE.qemu.MemoryInputPanel', { }, }, }, + { + xtype: 'proxmoxcheckbox', + name: 'allow-ksm', + labelWidth: labelWidth, + fieldLabel: gettext('Allow KSM'), + checked: true, + uncheckedValue: '0', + defaultValue: '1', + deleteDefaultValue: true, + autoEl: { + tag: 'div', + 'data-qtip': gettext( + 'Allow the Kernel Samepage Merging daemon to merge memory pages of this VM.', + ), + }, + }, ]; if (me.insideWizard) { @@ -183,6 +215,7 @@ Ext.define('PVE.qemu.MemoryEdit', { shares: data.shares, memory: data.memory || '512', balloon: data.balloon > 0 ? data.balloon : data.memory || '512', + 'allow-ksm': data['allow-ksm'] ?? true, }; ipanel.setValues(values); -- 2.47.3 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel