mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-01 01:04:32 +00:00
machine: get current: return early from loop if possible
No point iterating through the rest if we already got the current machine. Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
7d6a629269
commit
be690b7a91
@ -29,11 +29,12 @@ sub current_from_query_machines {
|
|||||||
$current = $machine->{name};
|
$current = $machine->{name};
|
||||||
# pve-version only exists for the current machine
|
# pve-version only exists for the current machine
|
||||||
$current .= "+$machine->{'pve-version'}" if $machine->{'pve-version'};
|
$current .= "+$machine->{'pve-version'}" if $machine->{'pve-version'};
|
||||||
|
return $current;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# fallback to the default machine if current is not supported by qemu
|
# 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
|
# this only works if VM is running
|
||||||
|
Loading…
Reference in New Issue
Block a user