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 80B121FF133 for ; Mon, 11 May 2026 16:15:04 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 06A081C173; Mon, 11 May 2026 16:15:02 +0200 (CEST) Date: Mon, 11 May 2026 16:14:23 +0200 From: Arthur Bied-Charreton To: Fiona Ebner Subject: Re: [PATCH pve-manager v4 13/17] ui: cpu flags selector: add CPU flag editor for custom models Message-ID: References: <20260430160109.565536-1-a.bied-charreton@proxmox.com> <20260430160109.565536-14-a.bied-charreton@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1778508753233 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.770 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: CZ5T22N6P5GHTVG4RRC4GHADAEZQOM7V X-Message-ID-Hash: CZ5T22N6P5GHTVG4RRC4GHADAEZQOM7V X-MailFrom: a.bied-charreton@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 CC: pve-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Mon, May 11, 2026 at 01:35:19PM +0200, Fiona Ebner wrote: > 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? > Yes, that sounds like a good solution. The way kvm/tcg flags are juggled back and forth when changing the radio button is a bit confusing, I was not very happy with it it either. I will implement this in v5! > > 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. > True, my bad - will fix that > > 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)? > Yes, that makes sense. > > .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 > ack > > ---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. Oops, will look into it, thanks for reporting