[pve-devel] [PATCH v3 container 4/5] config: is_volume_in_use: ability to search only snapshots

Wolfgang Bumiller w.bumiller at proxmox.com
Tue Sep 26 14:43:03 CEST 2017


---
This patch is new.

 src/PVE/LXC/Config.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
index c45ce7e..0330d5e 100644
--- a/src/PVE/LXC/Config.pm
+++ b/src/PVE/LXC/Config.pm
@@ -1176,14 +1176,14 @@ sub classify_mountpoint {
 }
 
 sub is_volume_in_use {
-    my ($class, $config, $volid, $include_snapshots) = @_;
+    my ($class, $config, $volid, $include_snapshots, $only_snapshots) = @_;
     my $used = 0;
 
     $class->foreach_mountpoint($config, sub {
 	my ($ms, $mountpoint) = @_;
 	return if $used;
 	$used = $mountpoint->{type} eq 'volume' && $mountpoint->{volume} eq $volid;
-    });
+    }) if !$only_snapshots;
 
     my $snapshots = $config->{snapshots};
     if ($include_snapshots && $snapshots) {
-- 
2.11.0





More information about the pve-devel mailing list