5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-26 10:03:51 +03:00

drive: volume in-use check: remove unused closure parameter

and simplify the calling iteration.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fabian Ebner 2021-04-19 15:39:50 +02:00 committed by Thomas Lamprecht
parent b68a957b2e
commit ab5b97d8a8

View File

@ -574,7 +574,7 @@ sub is_volume_in_use {
my $path = PVE::Storage::path($storecfg, $volid);
my $scan_config = sub {
my ($cref, $snapname) = @_;
my ($cref) = @_;
foreach my $key (keys %$cref) {
my $value = $cref->{$key};
@ -602,8 +602,8 @@ sub is_volume_in_use {
undef $skip_drive;
foreach my $snapname (keys %{$conf->{snapshots}}) {
return 1 if &$scan_config($conf->{snapshots}->{$snapname}, $snapname);
for my $snap (values %{$conf->{snapshots}}) {
return 1 if $scan_config->($snap);
}
return 0;