This check ensures that disks aren't unintentionally shrunken, if the
size is zero due to an underlying problem.
---
 src/PVE/API2/LXC.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm
index faec445..f08b6a5 100644
--- a/src/PVE/API2/LXC.pm
+++ b/src/PVE/API2/LXC.pm
@@ -1639,6 +1639,9 @@ __PACKAGE__->register_method({
            PVE::Storage::activate_volumes($storage_cfg, [$volid]);
 
            my $size = PVE::Storage::volume_size_info($storage_cfg, $volid, 5);
+
+           die "volume $volid does not exists\n" if !$size;
+
            $newsize += $size if $ext;
            $newsize = int($newsize);
 
-- 
2.20.1

_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to