From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH qemu-server 1/4] cpu config: split resolve_cpu_flags() function
Date: Mon, 23 Mar 2026 14:27:21 +0100 [thread overview]
Message-ID: <20260323132857.125747-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20260323132857.125747-1-f.ebner@proxmox.com>
In preparation to re-use the resolved flags for a check.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/QemuServer/CPUConfig.pm | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/PVE/QemuServer/CPUConfig.pm b/src/PVE/QemuServer/CPUConfig.pm
index 1a4f2510..c689efad 100644
--- a/src/PVE/QemuServer/CPUConfig.pm
+++ b/src/PVE/QemuServer/CPUConfig.pm
@@ -778,7 +778,7 @@ sub is_abstracted {
# },
# ...
# }
-sub resolve_cpu_flags {
+my sub resolve_cpu_flags {
my @flag_hashes = @_;
my $flags = {};
@@ -836,6 +836,12 @@ sub resolve_cpu_flags {
}
}
+ return $flags;
+}
+
+my sub print_cpu_flags {
+ my ($flags) = @_;
+
my $flag_str = '';
# sort for command line stability
for my $flag_name (sort keys %$flags) {
@@ -957,7 +963,7 @@ sub get_cpu_options {
my $cpu_str = $cputype;
# will be resolved in parameter order
- $cpu_str .= resolve_cpu_flags(
+ my $resolved_flags = resolve_cpu_flags(
$pve_flags,
$hv_flags,
$builtin_cputype_flags,
@@ -965,6 +971,7 @@ sub get_cpu_options {
$vm_flags,
$pve_forced_flags,
);
+ $cpu_str .= print_cpu_flags($resolved_flags);
for my $phys_bits_opt (qw(guest-phys-bits phys-bits)) {
my $phys_bits = '';
--
2.47.3
next prev parent reply other threads:[~2026-03-23 13:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 13:27 [PATCH-SERIES qemu-server 0/4] cpu config: warn that OVMF might limit phys-bits to 40 without pdpe1gb CPU flag Fiona Ebner
2026-03-23 13:27 ` Fiona Ebner [this message]
2026-03-23 13:27 ` [PATCH qemu-server 2/4] move get_host_phys_address_bits() to helpers module Fiona Ebner
2026-03-23 13:27 ` [PATCH qemu-server 3/4] cpu config: get cpu options: avoid shadowing $conf variable Fiona Ebner
2026-03-23 13:27 ` [PATCH qemu-server 4/4] cpu config: warn that OVMF might limit phys-bits to 40 without pdpe1gb CPU flag Fiona Ebner
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=20260323132857.125747-2-f.ebner@proxmox.com \
--to=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