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 5416E1FF16B for ; Fri, 7 Nov 2025 10:04:48 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7EEB6C14B; Fri, 7 Nov 2025 10:05:30 +0100 (CET) Message-ID: <8d5caa32-2221-4480-8168-8cf59e56e0f1@proxmox.com> Date: Fri, 7 Nov 2025 10:05:26 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Thomas Lamprecht , Proxmox VE development discussion References: <20251031122834.62482-1-f.ebner@proxmox.com> <20251031122834.62482-4-f.ebner@proxmox.com> <5dfef7b0-20e2-4d2d-9384-949b7be7d140@proxmox.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: <5dfef7b0-20e2-4d2d-9384-949b7be7d140@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1762506307267 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.068 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 PROLO_LEO1 0.1 Meta Catches all Leo drug variations so far SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH qemu-server 3/7] api: add endpoint for querying available cpu flags X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Am 06.11.25 um 7:01 PM schrieb Thomas Lamprecht: > Am 31.10.25 um 13:28 schrieb Fiona Ebner: >> Descriptions and ordering are taken from pve-manager's >> VMCPUFlagSelector.js. The double quotes in the descriptions were >> replaced with single quotes to have nicer JSON output. >> >> Signed-off-by: Fiona Ebner >> --- >> src/PVE/API2/Qemu/CPUFlags.pm | 45 +++++++++++++++++++ >> src/PVE/API2/Qemu/Makefile | 2 +- >> src/PVE/QemuServer/CPUConfig.pm | 76 +++++++++++++++++++++++++-------- >> 3 files changed, 105 insertions(+), 18 deletions(-) >> create mode 100644 src/PVE/API2/Qemu/CPUFlags.pm >> >> diff --git a/src/PVE/API2/Qemu/CPUFlags.pm b/src/PVE/API2/Qemu/CPUFlags.pm >> new file mode 100644 >> index 00000000..cc06a1d6 >> --- /dev/null >> +++ b/src/PVE/API2/Qemu/CPUFlags.pm >> @@ -0,0 +1,45 @@ > >> +__PACKAGE__->register_method({ > >> + links => [{ rel => 'child', href => '{flag}' }], > > We do not have any routes below this, is there any benefit of > declaring the links upfront? OTOH, there's also no real downside > either IIRC so probably can stay. I originally copied it from the one for CPU models and then changed it to 'flag', but later renamed the property to 'name', introducing a mismatch again. I'll just drop it in v2. >> diff --git a/src/PVE/QemuServer/CPUConfig.pm b/src/PVE/QemuServer/CPUConfig.pm >> index e72bdf2f..20e26ee2 100644 >> --- a/src/PVE/QemuServer/CPUConfig.pm >> +++ b/src/PVE/QemuServer/CPUConfig.pm >> @@ -161,21 +161,62 @@ my $cpu_vendor_list = { >> max => 'default', >> }; >> >> -my @supported_cpu_flags = ( >> - 'pcid', >> - 'spec-ctrl', >> - 'ibpb', >> - 'ssbd', >> - 'virt-ssbd', >> - 'amd-ssbd', >> - 'amd-no-ssb', >> - 'pdpe1gb', >> - 'md-clear', >> - 'hv-tlbflush', >> - 'hv-evmcs', >> - 'aes', >> -); >> -my $cpu_flag_supported_re = qr/([+-])(@{[join('|', @supported_cpu_flags)]})/; >> +our $supported_cpu_flags = [ > > I'd slightly prefer keeping this private to the module here and instead add a > getter method. Doing so reduces the impact for side-effect when some usage side > would modify this array-ref by accident. Will do in v2! _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel