[PATCH qemu-server 3/4] cpu config: get cpu options: avoid shadowing $conf variable

Fiona Ebner
2026-03-23T13:28:57Z

src/PVE/QemuServer/CPUConfig.pm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/PVE/QemuServer/CPUConfig.pm b/src/PVE/QemuServer/CPUConfig.pm
index c689efad..8da9010e 100644
--- a/src/PVE/QemuServer/CPUConfig.pm
+++ b/src/PVE/QemuServer/CPUConfig.pm
@@ -975,9 +975,9 @@ sub get_cpu_options {

for my $phys_bits_opt (qw(guest-phys-bits phys-bits)) {
my $phys_bits = '';
- foreach my $conf ($custom_cpu, $cpu) {
- next if !defined($conf);
- my $conf_val = $conf->{$phys_bits_opt};
+ for my $cpu_conf ($custom_cpu, $cpu) {
+ next if !defined($cpu_conf);
+ my $conf_val = $cpu_conf->{$phys_bits_opt};
next if !$conf_val;
if ($conf_val eq 'host') {
die "unexpected value 'host' for guest-phys-bits"
--
2.47.3