From aea2fcae82f9d2a25d64fa07bf60d56816ce9e7b Mon Sep 17 00:00:00 2001 From: Fiona Ebner Date: Fri, 18 Jul 2025 12:20:08 +0200 Subject: [PATCH] lvm plugin: list images: properly handle qcow2 format In particular, this also fixes volume rescan. Fixes: eda88c9 ("lvmplugin: add qcow2 snapshot") Signed-off-by: Fiona Ebner Link: https://lore.proxmox.com/20250718102023.70591-2-f.ebner@proxmox.com --- src/PVE/Storage/LVMPlugin.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/PVE/Storage/LVMPlugin.pm b/src/PVE/Storage/LVMPlugin.pm index 6d57097..e14f12d 100644 --- a/src/PVE/Storage/LVMPlugin.pm +++ b/src/PVE/Storage/LVMPlugin.pm @@ -752,11 +752,17 @@ sub list_images { next if defined($vmid) && ($owner ne $vmid); } + my $format = ($class->parse_volname($volname))[6]; + my $size = + $format eq 'qcow2' + ? $class->volume_size_info($scfg, $storeid, $volname) + : $info->{lv_size}; + push @$res, { volid => $volid, - format => 'raw', - size => $info->{lv_size}, + format => $format, + size => $size, vmid => $owner, ctime => $info->{ctime}, };