]> git.proxmox.com Git - qemu-server.git/blobdiff - PVE/QemuServer/Machine.pm
machine: get current: return early from loop if possible
[qemu-server.git] / PVE / QemuServer / Machine.pm
index 85cfb89cc8168e3a8388c73756f11c3fc0916cfd..c9fc9a3d66cbddc8df5c500fa08375259691264b 100644 (file)
@@ -29,11 +29,12 @@ sub current_from_query_machines {
            $current = $machine->{name};
            # pve-version only exists for the current machine
            $current .= "+$machine->{'pve-version'}" if $machine->{'pve-version'};
+           return $current;
        }
     }
 
     # fallback to the default machine if current is not supported by qemu
-    return $current || $default || 'pc';
+    return $default || 'pc';
 }
 
 # this only works if VM is running