From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 9921F1FF133 for ; Mon, 11 May 2026 13:35:59 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 923E314508; Mon, 11 May 2026 13:35:57 +0200 (CEST) Message-ID: Date: Mon, 11 May 2026 13:35:19 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH pve-manager v4 13/17] ui: cpu flags selector: add CPU flag editor for custom models To: Arthur Bied-Charreton , pve-devel@lists.proxmox.com References: <20260430160109.565536-1-a.bied-charreton@proxmox.com> <20260430160109.565536-14-a.bied-charreton@proxmox.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: <20260430160109.565536-14-a.bied-charreton@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1778499208119 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.009 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 SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com] Message-ID-Hash: VKFQJ4NPQGHQ7MCXLMYD5SIUKYAWQUJV X-Message-ID-Hash: VKFQJ4NPQGHQ7MCXLMYD5SIUKYAWQUJV X-MailFrom: f.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Am 30.04.26 um 6:01 PM schrieb Arthur Bied-Charreton: > Add CPU flag editor to the CPUTypeEdit component by extending the > VMCPUFlagSelector also used in the VM creation flow. This adds config > fields allowing to differentiate whether the component is being used in > the VM creation wizard, processor edit window, or for a custom CPU > model. > > For each flag in the selector, also display which node(s) it is available > on, and add a radio group allowing to select which acceleration type > flag availability should be checked for. > > In the VM processor edit window, pre-select the acceleration type based > on the value of `kvm` in the VM's config (`kvm` for `kvm: 1`, otherwise > `tcg`). > > In the VM creation wizard, show VM-specific flags, allowing the user to > filter by acceleration type themselves. I feel like this is not ideal, because you can select TCG, and flags for it, but the VM will still be created with default KVM accel, because the radio buttons don't function as an actual form field for the acceleration setting. I think the cleanest solution would be to explicitly add a checkbox for the 'kvm' qm.conf setting, which is then actually applied and show that instead of the two radio buttons. This can also be in the VM CPU edit window. Since it's not only related to the flags, it should not be part of the flags component, but rather trigger a reload of the flags component when changed. It should also be made clear that TCG is slower and KVM is hardware-based acceleration and highly recommended. What do you think? > In the custom CPU model creation/edit window, show all flags available > cluster-wide, allowing the user to filter by acceleration type. > > Show unknown flags, i.e. flags that either the currently selected > acceleration type does not support or that do not exist, at the top > of the list to encourage users to reconsider whether they should be set > at all. > > Based on & adapted from patch by Stefan Reiter: > https://lore.proxmox.com/pve-devel/20211028114150.3245864-10-s.reiter@proxmox.com > In the virtual machine create wizard/CPU edit, there are no title columns. Especially for "Supported On" it would be helpful to have. > Signed-off-by: Arthur Bied-Charreton > --- > www/css/ext6-pve.css | 4 + > www/manager6/dc/CPUTypeEdit.js | 11 +- > www/manager6/form/CPUModelSelector.js | 1 + > www/manager6/form/VMCPUFlagSelector.js | 218 +++++++++++++++++++++---- > www/manager6/qemu/ProcessorEdit.js | 6 + > 5 files changed, 210 insertions(+), 30 deletions(-) > > diff --git a/www/css/ext6-pve.css b/www/css/ext6-pve.css > index 27742a74..98f5e6ed 100644 > --- a/www/css/ext6-pve.css > +++ b/www/css/ext6-pve.css > @@ -655,6 +655,10 @@ table.osds td:first-of-type { > opacity: 0.3; > } > > +.x-toolbar .x-form-item-default.x-item-disabled { > + opacity: 0.8; > +} > + Yes, it looks better in this case. But I'm not sure we should do it via a global CSS setting. Maybe the acceleration should rather be shown as a label if it's fixed (rather than two radio buttons)? > .pmx-action-hidden:before { > opacity: 0; > cursor: default; > diff --git a/www/manager6/dc/CPUTypeEdit.js b/www/manager6/dc/CPUTypeEdit.js > index 594772ed..fe7652a3 100644 > --- a/www/manager6/dc/CPUTypeEdit.js > +++ b/www/manager6/dc/CPUTypeEdit.js > @@ -26,7 +26,6 @@ Ext.define('PVE.dc.CPUTypeEdit', { > isCreate: (get) => get('isCreate'), > }, > > - > items: [ > { > xtype: 'inputpanel', Nit: unrelated change ---snip 8<--- > + xtype: 'tbtext', > + text: gettext('Acceleration:'), > + autoEl: { > + tag: 'span', > + 'data-qtip': gettext( > + 'A custom CPU model using acceleration-specific flags can only be assigned to VMs configured with the matching acceleration type, i.e., "kvm: 1" for KVM, or "kvm: 0" for TCG.', Seems like the tooltip is cut off after the "i.e.," when looking at it with a browser for some reason.