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 4DE3C1FF136 for ; Mon, 23 Mar 2026 15:46:35 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 343191F650; Mon, 23 Mar 2026 15:46:53 +0100 (CET) Message-ID: <1dd87137-0907-453d-8add-4c4dfdfe73ea@proxmox.com> Date: Mon, 23 Mar 2026 15:46:45 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Fiona Ebner Subject: Re: [PATCH qemu-server 8/8] api: qemu: Add CRUD handlers for custom CPU models To: Arthur Bied-Charreton , pve-devel@lists.proxmox.com References: <20260312084021.124465-1-a.bied-charreton@proxmox.com> <20260312084021.124465-9-a.bied-charreton@proxmox.com> Content-Language: en-US In-Reply-To: <20260312084021.124465-9-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: 1774277159234 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.145 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 POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: TPJ4QXIO2X42R4A3RHSQOURICM4K4B5I X-Message-ID-Hash: TPJ4QXIO2X42R4A3RHSQOURICM4K4B5I 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 12.03.26 um 9:40 AM schrieb Arthur Bied-Charreton: > Add GET handlers for both all custom CPU models and specific ones, POST > handler for creating custom CPU models, PUT handler for updating them, > and DELETE handler for deleting them. > > Original patches: > https://lore.proxmox.com/pve-devel/20211028114150.3245864-4-s.reiter@proxmox.com/ > https://lore.proxmox.com/pve-devel/20211028114150.3245864-5-s.reiter@proxmox.com/ > > Originally-by: Stefan Reiter > Signed-off-by: Arthur Bied-Charreton > --- > src/PVE/API2/Qemu/CPU.pm | 236 ++++++++++++++++++++++++++++++++++++++- > 1 file changed, 235 insertions(+), 1 deletion(-) > > diff --git a/src/PVE/API2/Qemu/CPU.pm b/src/PVE/API2/Qemu/CPU.pm > index f8a7e11d..9d89504d 100644 > --- a/src/PVE/API2/Qemu/CPU.pm > +++ b/src/PVE/API2/Qemu/CPU.pm > @@ -52,7 +52,7 @@ __PACKAGE__->register_method({ > }, > }, > }, > - links => [{ rel => 'child', href => '{name}' }], > + links => [{ rel => 'child', href => 'model/{cputype}' }], Pre-existing issues from the original series: This does not work in pvesh, because the extract_children() function there only matches: if ($href =~ m/^\{(\S+)\}$/) { Also, it's called 'name' in the returned result, not 'cputype'. But this is the wrong place for a link to begin with, since we only want to provide the link for custom models, it should be added to the 'model' endpoint. There, it is called 'cputype' ;) Having the 'model' endpoint below here seems wrong to me, for two reasons: 1. Since the 'cpu' endpoint already returns a result other than an index of sub-endpoints, it cannot at the same time show in its result that the sub-endpoint exists, and this breaks the directory structure. 2. It's below /nodes/ but it's touching cluster-wide configuration. I think we should just have a new, dedicated endpoint, maybe /cluster/qemu/custom-cpu-models? And then, we might want to drop the need for specifying a 'custom-' prefix when using the calls?