Aside from what Thomas found with 'get_host_arch'
there is one high level comment i have, but IMHO it's not a blocker:

I'm not a super fan of "sprinkling" `eq 'x86_64'` or similar throughout
the code, but for the cases used here it's probably ok.

If we encounter more such things though, I'd really like some
more general lookup for arch -> values or something like this.

even if it's just a 'supports_x' helper that has a hash
like
{
x86_64 => 1,
aarch64 => 0,
xxx => yyy,
}
etc

But as I wrote, for these use cases here probably ok, and
definitely no blocker for now since that can be cleaned
up whenever we see fit.

Aside from that,

Reviewed-by: Dominik Csapak <[email protected]>
Tested-by: Dominik Csapak <[email protected]>

On 1/29/26 2:09 PM, Fiona Ebner wrote:
Changes in v2:
* also support querying flags for a specific arch
* style: fix include ordering in CPU API module

Previously, only the default 'cortex-a57' CPU model would be used
implicitly. Group models and built-in models by architecture, since
that is what (most) use sites are interested in. Note that the 'host'
model only exists if the host arch matches the emulator/vCPU arch.

Some use sites do require a list of all possible ones, e.g. custom
types, because they are not namespaced by arch.

qemu-server:

Fiona Ebner (8):
   cpu config: introduce pve-qm-cpu-arch standard option for virtual CPU
     architecture
   cpu config: guard adding hyperv enlightenments by arch
   cpu config: 'hidden' option only applies to vCPUs with x86_64 arch
   cpu config: introduce module-wide $host_arch variable
   cpu config: support aarch64 CPU models
   api: cpu: allow querying CPU models for a given architecture
   cpu config: support aarch64 CPU flags
   api: cpu flags: allow querying CPU flags for a given architecture

  src/PVE/API2/Qemu/CPU.pm        |   8 +-
  src/PVE/API2/Qemu/CPUFlags.pm   |  11 +-
  src/PVE/QemuServer.pm           |   7 +-
  src/PVE/QemuServer/CPUConfig.pm | 453 ++++++++++++++++++--------------
  4 files changed, 279 insertions(+), 200 deletions(-)


Summary over all repositories:
   4 files changed, 279 insertions(+), 200 deletions(-)





Reply via email to