public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Fiona Ebner <f.ebner@proxmox.com>
Subject: Re: [pve-devel] [PATCH qemu-server 3/7] api: add endpoint for querying available cpu flags
Date: Thu, 6 Nov 2025 19:02:12 +0100	[thread overview]
Message-ID: <5dfef7b0-20e2-4d2d-9384-949b7be7d140@proxmox.com> (raw)
In-Reply-To: <20251031122834.62482-4-f.ebner@proxmox.com>

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 <f.ebner@proxmox.com>
> ---
>  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


  reply	other threads:[~2025-11-06 18:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-31 12:27 [pve-devel] [PATCH-SERIES qemu-server/manager 0/7] VM CPU flags: introduce vendor-agnostic 'nested-virt' CPU flag Fiona Ebner
2025-10-31 12:27 ` [pve-devel] [PATCH qemu-server 1/7] cpu config: style fix: avoid multiline post-if expressions Fiona Ebner
2025-11-06 18:03   ` [pve-devel] applied: " Thomas Lamprecht
2025-10-31 12:27 ` [pve-devel] [PATCH qemu-server 2/7] cpu config: style fix: avoid overly long ternary conditional expression Fiona Ebner
2025-11-06 18:03   ` [pve-devel] applied: " Thomas Lamprecht
2025-10-31 12:27 ` [pve-devel] [PATCH qemu-server 3/7] api: add endpoint for querying available cpu flags Fiona Ebner
2025-11-06 18:02   ` Thomas Lamprecht [this message]
2025-11-06 18:17     ` Thomas Lamprecht
2025-11-07  9:05     ` Fiona Ebner
2025-10-31 12:27 ` [pve-devel] [PATCH qemu-server 4/7] cpu config: introduce vendor-agnostic 'nested-virt' CPU flag Fiona Ebner
2025-11-06 17:00   ` Daniel Kral
2025-11-07  9:12     ` Fiona Ebner
2025-10-31 12:27 ` [pve-devel] [PATCH manager 5/7] api: capabilities: register module for VM CPU flags Fiona Ebner
2025-10-31 12:27 ` [pve-devel] [PATCH manager 6/7] ui: cpu flag selector: code style: use 'let' for declarations Fiona Ebner
2025-10-31 12:27 ` [pve-devel] [PATCH manager 7/7] ui: cpu flag selector: query CPU flag list via API Fiona Ebner
2025-11-06 16:57   ` Daniel Kral
2025-11-07  9:30     ` Fiona Ebner
2025-11-06 17:13 ` [pve-devel] [PATCH-SERIES qemu-server/manager 0/7] VM CPU flags: introduce vendor-agnostic 'nested-virt' CPU flag Daniel Kral
2025-11-07 11:33   ` Fiona Ebner
2025-11-07 12:13     ` Daniel Kral

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5dfef7b0-20e2-4d2d-9384-949b7be7d140@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal