public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server] drive: volume in-use check: remove unused closure parameter
@ 2021-04-19 13:39 Fabian Ebner
  2021-04-19 20:09 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Ebner @ 2021-04-19 13:39 UTC (permalink / raw)
  To: pve-devel

and simplify the calling iteration.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
 PVE/QemuServer/Drive.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/PVE/QemuServer/Drive.pm b/PVE/QemuServer/Drive.pm
index 9016a43..0d66b2e 100644
--- a/PVE/QemuServer/Drive.pm
+++ b/PVE/QemuServer/Drive.pm
@@ -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;
-- 
2.20.1





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-19 20:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-19 13:39 [pve-devel] [PATCH qemu-server] drive: volume in-use check: remove unused closure parameter Fabian Ebner
2021-04-19 20:09 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal