[PATCH FOLLOW-UP storage 07/14] lvmplugin: alloc_snap_image: die if file_size_info return empty size

Alexandre Derumier alexandre.derumier at groupe-cyllene.com
Wed Jul 16 08:31:46 CEST 2025


Signed-off-by: Alexandre Derumier <alexandre.derumier at groupe-cyllene.com>
---
 src/PVE/Storage/LVMPlugin.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/PVE/Storage/LVMPlugin.pm b/src/PVE/Storage/LVMPlugin.pm
index 54070d1..cb5fd37 100644
--- a/src/PVE/Storage/LVMPlugin.pm
+++ b/src/PVE/Storage/LVMPlugin.pm
@@ -668,6 +668,8 @@ my sub alloc_snap_image {
 
     #we need to use same size than the backing image qcow2 virtual-size
     my $size = PVE::Storage::Plugin::file_size_info($path, 5, $format);
+    die "file_size_info on '$volname' failed\n" if !defined($size);
+
     $size = $size / 1024; #we use kb in lvcreate
 
     alloc_lvm_image($class, $storeid, $scfg, $vmid, $format, $volname, $size, $backing_snap);
-- 
2.39.5




More information about the pve-devel mailing list