]> git.proxmox.com Git - qemu-server.git/commitdiff
machine: get current: improve naming and style
authorFiona Ebner <f.ebner@proxmox.com>
Fri, 10 Nov 2023 13:24:46 +0000 (14:24 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sun, 12 Nov 2023 17:48:01 +0000 (18:48 +0100)
No functional change intended.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
PVE/QemuServer/Machine.pm

index d9429ed45fad878c6c67e7ff88539e779b3caa7f..a4bc24a5bbf9de5c60a585edfcdf91c79b60b811 100644 (file)
@@ -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;