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 0C1E41FF165 for ; Thu, 6 Nov 2025 19:02:07 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id DFEE51EE22; Thu, 6 Nov 2025 19:02:46 +0100 (CET) Message-ID: <5dfef7b0-20e2-4d2d-9384-949b7be7d140@proxmox.com> Date: Thu, 6 Nov 2025 19:02:12 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta To: Proxmox VE development discussion , Fiona Ebner References: <20251031122834.62482-1-f.ebner@proxmox.com> <20251031122834.62482-4-f.ebner@proxmox.com> Content-Language: en-US From: Thomas Lamprecht In-Reply-To: <20251031122834.62482-4-f.ebner@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1762452113592 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.075 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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. [cpuflags.pm, cpuconfig.pm] 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 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. > 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. _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel