mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-04-30 19:31:54 +00: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:
parent
b68a957b2e
commit
ab5b97d8a8
@ -574,7 +574,7 @@ sub is_volume_in_use {
|
|||||||
my $path = PVE::Storage::path($storecfg, $volid);
|
my $path = PVE::Storage::path($storecfg, $volid);
|
||||||
|
|
||||||
my $scan_config = sub {
|
my $scan_config = sub {
|
||||||
my ($cref, $snapname) = @_;
|
my ($cref) = @_;
|
||||||
|
|
||||||
foreach my $key (keys %$cref) {
|
foreach my $key (keys %$cref) {
|
||||||
my $value = $cref->{$key};
|
my $value = $cref->{$key};
|
||||||
@ -602,8 +602,8 @@ sub is_volume_in_use {
|
|||||||
|
|
||||||
undef $skip_drive;
|
undef $skip_drive;
|
||||||
|
|
||||||
foreach my $snapname (keys %{$conf->{snapshots}}) {
|
for my $snap (values %{$conf->{snapshots}}) {
|
||||||
return 1 if &$scan_config($conf->{snapshots}->{$snapname}, $snapname);
|
return 1 if $scan_config->($snap);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user