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 977C51FF13F for ; Thu, 12 Mar 2026 09:41:08 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6722D98C0; Thu, 12 Mar 2026 09:40:59 +0100 (CET) From: Arthur Bied-Charreton To: pve-devel@lists.proxmox.com Subject: [PATCH manager/qemu-server 0/8] Add API and UI for custom CPU models Date: Thu, 12 Mar 2026 09:40:13 +0100 Message-ID: <20260312084021.124465-1-a.bied-charreton@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.107 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 KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods RDNS_NONE 0.793 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Message-ID-Hash: IGV2W7YM26E73G6GSU7ETDAF3BJJLDER X-Message-ID-Hash: IGV2W7YM26E73G6GSU7ETDAF3BJJLDER X-MailFrom: abied-charreton@jett.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: This is picked up from an old series [0] by Stefan Reiter. As of before this series, the only way to create custom CPU models is by editing `/etc/pve/virtual-guest/cpu-models.conf` manually. This can be cumbersome for a few reasons, e.g., due to the fact that flags misconfigurations are only caught when starting the VM. `cpu-flags` endpoint: The `cpu-flags` endpoint previously returned a list of hardcoded flags, which is both non-exhaustive (some flags I should be able to set are missing), and partly incorrect (some flags my host(s) do not support set are returned). This is limiting and can lead to misconfigurations. The updated endpoint intersects all flags QEMU accepts as `-cpu` arguments with all flags the host hardware/emulation actually supports. This way, if I am able to set a flag in the UI, I can be confident that the VM will actually be able to start. Custom CPU model CRUD functionality: Expose CRUD endpoints and UI flow to interact with `cpu-models.conf`. For each flag, show a list of the cluster nodes supporting it, and only expose flags that at least one node supports to avoid misconfigurations. Filter flags by acceleration type (KVM/TCG). [0] https://lore.proxmox.com/pve-devel/20211028114150.3245864-1-s.reiter@proxmox.com/ pve-manager: Arthur Bied-Charreton (5): ui: VMCPUFlagSelector: Fix unknownFlags behaviour ui: CPUModelSelector: Fix dirty state on default ui: CPUModelSelector: Allow filtering out custom models ui: Add basic custom CPU model editor ui: Add CPU flag editor for custom models www/manager6/Makefile | 3 + www/manager6/dc/CPUTypeEdit.js | 99 ++++++++++++++++ www/manager6/dc/CPUTypeView.js | 139 ++++++++++++++++++++++ www/manager6/dc/Config.js | 6 + www/manager6/form/CPUModelSelector.js | 18 ++- www/manager6/form/PhysBitsSelector.js | 153 +++++++++++++++++++++++++ www/manager6/form/VMCPUFlagSelector.js | 135 ++++++++++++++++++---- 7 files changed, 529 insertions(+), 24 deletions(-) create mode 100644 www/manager6/dc/CPUTypeEdit.js create mode 100644 www/manager6/dc/CPUTypeView.js create mode 100644 www/manager6/form/PhysBitsSelector.js qemu-server: Arthur Bied-Charreton (3): qemu: Add helpers for new custom models endpoints api: qemu: Extend cpu-flags endpoint to return actually supported flags api: qemu: Add CRUD handlers for custom CPU models src/PVE/API2/Qemu/CPU.pm | 236 +++++++++++++++++++++++++++++++- src/PVE/API2/Qemu/CPUFlags.pm | 108 ++++++++++++++- src/PVE/QemuServer/CPUConfig.pm | 35 ++++- 3 files changed, 374 insertions(+), 5 deletions(-) Summary over all repositories: 10 files changed, 903 insertions(+), 29 deletions(-) -- Generated by murpp 0.9.0