[pve-devel] [PATCH] Bugfix 517: improve error message

Wolfgang Link w.link at proxmox.com
Mon Aug 17 14:27:11 CEST 2015


Get a understandble message,
if someone try to increase a qcow2 image where one or more snapshots reside
---
 PVE/API2/Qemu.pm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index 24a066f..5caaf1a 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -2648,6 +2648,12 @@ __PACKAGE__->register_method({
 
 	    my $drive = PVE::QemuServer::parse_drive($disk, $conf->{$disk});
 
+	    my (undef, undef, undef, undef, undef, undef, $format) =
+		PVE::Storage::parse_volname($storecfg, $drive->{file});
+
+	    die "can't resize volume: $disk if snapshot exists\n" 
+		if %{$conf->{snapshots}} && $format eq 'qcow2';
+
 	    my $volid = $drive->{file};
 
 	    die "disk '$disk' has no associated volume\n" if !$volid;
-- 
2.1.4





More information about the pve-devel mailing list