]> git.proxmox.com Git - pve-container.git/commitdiff
delete_mp: warn if we ignore a volume deletion due to wrong owner
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 18 Oct 2019 10:51:21 +0000 (12:51 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 18 Oct 2019 10:51:24 +0000 (12:51 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/LXC.pm

index 392122977c42f35b23e0058b5b302975e9bc785a..af6918a89998da017c40d5a3a4e1f71de315b929 100644 (file)
@@ -731,7 +731,12 @@ sub delete_mountpoint_volume {
     return if PVE::LXC::Config->classify_mountpoint($volume) ne 'volume';
 
     my ($vtype, $name, $owner) = PVE::Storage::parse_volname($storage_cfg, $volume);
-    PVE::Storage::vdisk_free($storage_cfg, $volume) if $vmid == $owner;
+
+    if ($vmid == $owner) {
+       PVE::Storage::vdisk_free($storage_cfg, $volume);
+    } else {
+       warn "ignore deletion of '$volume', CT $vmid isn't the owner!\n";
+    }
 }
 
 sub destroy_lxc_container {