[pve-devel] [PATCH qemu-server 2/2] remove old move disk snapshot check

Fabian Grünbichler f.gruenbichler at proxmox.com
Fri Jul 1 14:18:32 CEST 2016


this is no longer needed, if the moved disk was referenced
by a snapshot we have already died early, and the config is
locked.
---
 PVE/API2/Qemu.pm | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index 6a1a459..e6c082e 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -2572,17 +2572,11 @@ __PACKAGE__->register_method({
                 }
 
 		if ($param->{delete}) {
-                    if (PVE::QemuServer::is_volume_in_use($storecfg, $conf, undef, $old_volid)) {
-			warn "volume $old_volid still has snapshots, can't delete it\n";
-			PVE::QemuConfig->add_unused_volume($conf, $old_volid);
-			PVE::QemuConfig->write_config($vmid, $conf);
-		    } else {
-			eval {
-			    PVE::Storage::deactivate_volumes($storecfg, [$old_volid]);
-			    PVE::Storage::vdisk_free($storecfg, $old_volid);
-			};
-			warn $@ if $@;
-		    }
+		    eval {
+			PVE::Storage::deactivate_volumes($storecfg, [$old_volid]);
+			PVE::Storage::vdisk_free($storecfg, $old_volid);
+		    };
+		    warn $@ if $@;
 		}
 	    };
 
-- 
2.1.4




More information about the pve-devel mailing list