]> git.proxmox.com Git - pve-container.git/commitdiff
allow to check for in-use volumes in pending section
authorOguz Bektas <o.bektas@proxmox.com>
Mon, 14 Oct 2019 08:28:48 +0000 (10:28 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 18 Oct 2019 18:44:36 +0000 (20:44 +0200)
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
src/PVE/LXC/Config.pm

index 91c1d816918bab11379cacc54f8cc3d68261b5f0..66d72dbae0e44a9295b0072d9a8315cd830ca5fd 100644 (file)
@@ -1326,9 +1326,10 @@ sub is_volume_in_use_by_snapshots {
 }
 
 sub is_volume_in_use {
-    my ($class, $config, $volid, $include_snapshots) = @_;
+    my ($class, $config, $volid, $include_snapshots, $include_pending) = @_;
     return 1 if $__is_volume_in_use->($class, $config, $volid);
     return 1 if $include_snapshots && $class->is_volume_in_use_by_snapshots($config, $volid);
+    return 1 if $include_pending && $__is_volume_in_use->($class, $config->{pending}, $volid);
     return 0;
 }