In particular, this also fixes volume rescan.

Fixes: eda88c9 ("lvmplugin: add qcow2 snapshot")
Signed-off-by: Fiona Ebner <f.eb...@proxmox.com>
---

No changes in v2.

 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},
                 };
-- 
2.47.2



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

Reply via email to