public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH storage 1/2] lvm plugin: properly handle qcow2 format when querying volume size info
@ 2025-07-18 10:12 Fiona Ebner
  2025-07-18 10:12 ` [pve-devel] [PATCH storage 2/2] lvm plugin: list images: properly handle qcow2 format Fiona Ebner
  2025-07-18 10:21 ` [pve-devel] superseded: [PATCH storage 1/2] lvm plugin: properly handle qcow2 format when querying volume size info Fiona Ebner
  0 siblings, 2 replies; 3+ messages in thread
From: Fiona Ebner @ 2025-07-18 10:12 UTC (permalink / raw)
  To: pve-devel

Fixes: eda88c9 ("lvmplugin: add qcow2 snapshot")
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 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 storage 2/2] lvm plugin: list images: properly handle qcow2 format
  2025-07-18 10:12 [pve-devel] [PATCH storage 1/2] lvm plugin: properly handle qcow2 format when querying volume size info Fiona Ebner
@ 2025-07-18 10:12 ` Fiona Ebner
  2025-07-18 10:21 ` [pve-devel] superseded: [PATCH storage 1/2] lvm plugin: properly handle qcow2 format when querying volume size info Fiona Ebner
  1 sibling, 0 replies; 3+ messages in thread
From: Fiona Ebner @ 2025-07-18 10:12 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>
---
 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] superseded: [PATCH storage 1/2] lvm plugin: properly handle qcow2 format when querying volume size info
  2025-07-18 10:12 [pve-devel] [PATCH storage 1/2] lvm plugin: properly handle qcow2 format when querying volume size info Fiona Ebner
  2025-07-18 10:12 ` [pve-devel] [PATCH storage 2/2] lvm plugin: list images: properly handle qcow2 format Fiona Ebner
@ 2025-07-18 10:21 ` Fiona Ebner
  1 sibling, 0 replies; 3+ messages in thread
From: Fiona Ebner @ 2025-07-18 10:21 UTC (permalink / raw)
  To: pve-devel

Sorry, for the noise. I sent a v2 with better meta info:

https://lore.proxmox.com/pve-devel/20250718102023.70591-1-f.ebner@proxmox.com/T/#u

Am 18.07.25 um 12:12 PM schrieb Fiona Ebner:
> Fixes: eda88c9 ("lvmplugin: add qcow2 snapshot")
> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
>  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',



_______________________________________________
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:21 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:12 [pve-devel] [PATCH storage 1/2] lvm plugin: properly handle qcow2 format when querying volume size info Fiona Ebner
2025-07-18 10:12 ` [pve-devel] [PATCH storage 2/2] lvm plugin: list images: properly handle qcow2 format Fiona Ebner
2025-07-18 10:21 ` [pve-devel] superseded: [PATCH storage 1/2] lvm plugin: properly handle qcow2 format when querying volume size info Fiona Ebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal