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 3C1D41FF136 for ; Mon, 18 May 2026 08:47:49 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 357A5255E; Mon, 18 May 2026 08:46:07 +0200 (CEST) From: Arthur Bied-Charreton To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server v6 11/21] cpu models: add 'builtin' flag to CPU model list endpoint Date: Mon, 18 May 2026 08:45:16 +0200 Message-ID: <20260518064526.117067-12-a.bied-charreton@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260518064526.117067-1-a.bied-charreton@proxmox.com> References: <20260518064526.117067-1-a.bied-charreton@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.280 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 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 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: PKDOCOIL4QQHRUZQBP3NK5UO77LC3Q6T X-Message-ID-Hash: PKDOCOIL4QQHRUZQBP3NK5UO77LC3Q6T 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: The /nodes/{node}/capabilities/qemu/cpu endpoint returns both QEMU CPU models and PVE-builtin models (e.g., x86-64-v2) under the same 'custom: false' category, making them indistinguishable for API consumers. This is needed so the UI can filter out builtin models from the reported-model dropdown when creating custom CPU models, since builtin models are a PVE abstraction and not valid QEMU reported-model values. Signed-off-by: Arthur Bied-Charreton --- src/PVE/API2/Qemu/CPU.pm | 5 +++++ src/PVE/QemuServer/CPUConfig.pm | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/PVE/API2/Qemu/CPU.pm b/src/PVE/API2/Qemu/CPU.pm index f8a7e11d..c929933f 100644 --- a/src/PVE/API2/Qemu/CPU.pm +++ b/src/PVE/API2/Qemu/CPU.pm @@ -50,6 +50,11 @@ __PACKAGE__->register_method({ . " model is selected. Vendor of" . " 'reported-model' in case of custom models.", }, + builtin => { + type => 'boolean', + description => 'True if this is a builtin model', + optional => 1, + } }, }, links => [{ rel => 'child', href => '{name}' }], diff --git a/src/PVE/QemuServer/CPUConfig.pm b/src/PVE/QemuServer/CPUConfig.pm index 8c3a5c49..0dc83081 100644 --- a/src/PVE/QemuServer/CPUConfig.pm +++ b/src/PVE/QemuServer/CPUConfig.pm @@ -566,6 +566,7 @@ sub get_cpu_models { name => $default_model, custom => 0, vendor => $cpu_vendor_list->{$default_model}, + builtin => 0, }; } @@ -578,6 +579,7 @@ sub get_cpu_models { name => $model, custom => 0, vendor => $vendor, + builtin => 1, }; } @@ -593,6 +595,7 @@ sub get_cpu_models { name => "custom-$custom_model", custom => 1, vendor => $vendor, + builtin => 0, }; } -- 2.47.3