all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH v2 storage 1/2] lvm plugin: properly handle qcow2 format when querying volume size info
@ 2025-07-18 10:20 Fiona Ebner
  2025-07-18 10:20 ` [pve-devel] [PATCH v2 storage 2/2] lvm plugin: list images: properly handle qcow2 format Fiona Ebner
  2025-07-18 10:22 ` [pve-devel] applied-series: [PATCH v2 storage 1/2] lvm plugin: properly handle qcow2 format when querying volume size info Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Fiona Ebner @ 2025-07-18 10:20 UTC (permalink / raw)
  To: pve-devel

In particular this fixes moving a qcow2 on top of LVM to a different
storage.

Fixes: eda88c9 ("lvmplugin: add qcow2 snapshot")
Reported-by: Michael Köppl <m.koeppl@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---

Changes in v2:
* Add Reported-by trailer.
* Mention what this fixes in the commit message.

 src/PVE/Storage/LVMPlugin.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/PVE/Storage/LVMPlugin.pm b/src/PVE/Storage/LVMPlugin.pm
index 7044c4f..6d57097 100644
--- a/src/PVE/Storage/LVMPlugin.pm
+++ b/src/PVE/Storage/LVMPlugin.pm
@@ -930,8 +930,12 @@ sub volume_resize {
 
 sub volume_size_info {
     my ($class, $scfg, $storeid, $volname, $timeout) = @_;
+
+    my ($format) = ($class->parse_volname($volname))[6];
     my $path = $class->filesystem_path($scfg, $volname);
 
+    return PVE::Storage::Plugin::file_size_info($path, $timeout, $format) if $format eq 'qcow2';
+
     my $cmd = [
         '/sbin/lvs',
         '--separator',
-- 
2.47.2



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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pve-devel] [PATCH v2 storage 2/2] lvm plugin: list images: properly handle qcow2 format
  2025-07-18 10:20 [pve-devel] [PATCH v2 storage 1/2] lvm plugin: properly handle qcow2 format when querying volume size info Fiona Ebner
@ 2025-07-18 10:20 ` Fiona Ebner
  2025-07-18 10:22 ` [pve-devel] applied-series: [PATCH v2 storage 1/2] lvm plugin: properly handle qcow2 format when querying volume size info Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Fiona Ebner @ 2025-07-18 10:20 UTC (permalink / raw)
  To: pve-devel

In particular, this also fixes volume rescan.

Fixes: eda88c9 ("lvmplugin: add qcow2 snapshot")
Signed-off-by: Fiona Ebner <f.ebner@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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pve-devel] applied-series: [PATCH v2 storage 1/2] lvm plugin: properly handle qcow2 format when querying volume size info
  2025-07-18 10:20 [pve-devel] [PATCH v2 storage 1/2] lvm plugin: properly handle qcow2 format when querying volume size info Fiona Ebner
  2025-07-18 10:20 ` [pve-devel] [PATCH v2 storage 2/2] lvm plugin: list images: properly handle qcow2 format Fiona Ebner
@ 2025-07-18 10:22 ` Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2025-07-18 10:22 UTC (permalink / raw)
  To: pve-devel, Fiona Ebner

On Fri, 18 Jul 2025 12:20:07 +0200, Fiona Ebner wrote:
> In particular this fixes moving a qcow2 on top of LVM to a different
> storage.
> 
> 

Applied both patches, thanks!

[1/2] lvm plugin: properly handle qcow2 format when querying volume size info
      commit: 9b6e1387886981ff0585a3b62024a86631f5c17d
[2/2] lvm plugin: list images: properly handle qcow2 format
      commit: aea2fcae82f9d2a25d64fa07bf60d56816ce9e7b


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-07-18 10:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-18 10:20 [pve-devel] [PATCH v2 storage 1/2] lvm plugin: properly handle qcow2 format when querying volume size info Fiona Ebner
2025-07-18 10:20 ` [pve-devel] [PATCH v2 storage 2/2] lvm plugin: list images: properly handle qcow2 format Fiona Ebner
2025-07-18 10:22 ` [pve-devel] applied-series: [PATCH v2 storage 1/2] lvm plugin: properly handle qcow2 format when querying volume size info Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal