[pve-devel] [PATCH storage 2/4] fix #6584: plugin: list_images: only include parseable filenames
Fabian Grünbichler
f.gruenbichler at proxmox.com
Thu Jul 31 13:15:17 CEST 2025
by only including filenames that are also valid when actually parsing them,
things like snapshot files or files not following our naming scheme are no
longer candidates for rescanning or included in other output.
Co-authored-by: Shannon Sterz <s.sterz at proxmox.com>
Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
src/PVE/Storage/Plugin.pm | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm
index c08f5a5..affe7b0 100644
--- a/src/PVE/Storage/Plugin.pm
+++ b/src/PVE/Storage/Plugin.pm
@@ -1555,6 +1555,10 @@ sub list_images {
next if !$vollist && defined($vmid) && ($owner ne $vmid);
+ # skip files that are snapshots or have invalid names
+ my ($parsed_name) = eval { parse_name_dir(basename($fn)) };
+ next if !defined($parsed_name);
+
my ($size, undef, $used, $parent, $ctime) = eval { file_size_info($fn, undef, $format); };
if (my $err = $@) {
die $err if $err !~ m/Image is not in \S+ format$/;
--
2.39.5
More information about the pve-devel
mailing list