public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v2 storage 2/2] lvm plugin: list images: properly handle qcow2 format
Date: Fri, 18 Jul 2025 12:20:08 +0200	[thread overview]
Message-ID: <20250718102023.70591-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20250718102023.70591-1-f.ebner@proxmox.com>

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


  reply	other threads:[~2025-07-18 10:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2025-07-18 10:22 ` [pve-devel] applied-series: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250718102023.70591-2-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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