[pve-devel] [PATCH qemu-server 1/6] machine: get current: improve naming and style
Fiona Ebner
f.ebner at proxmox.com
Fri Nov 10 14:24:46 CET 2023
No functional change intended.
Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
PVE/QemuServer/Machine.pm | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/PVE/QemuServer/Machine.pm b/PVE/QemuServer/Machine.pm
index d9429ed4..a4bc24a5 100644
--- a/PVE/QemuServer/Machine.pm
+++ b/PVE/QemuServer/Machine.pm
@@ -19,13 +19,13 @@ sub machine_type_is_q35 {
}
sub current_from_query_machines {
- my ($res) = @_;
+ my ($machines) = @_;
my ($current, $pve_version, $default);
- foreach my $e (@$res) {
- $default = $e->{name} if $e->{'is-default'};
- $current = $e->{name} if $e->{'is-current'};
- $pve_version = $e->{'pve-version'} if $e->{'pve-version'};
+ for my $machine ($machines->@*) {
+ $default = $machine->{name} if $machine->{'is-default'};
+ $current = $machine->{name} if $machine->{'is-current'};
+ $pve_version = $machine->{'pve-version'} if $machine->{'pve-version'};
}
$current .= "+$pve_version" if $current && $pve_version;
--
2.39.2
More information about the pve-devel
mailing list