public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH-SERIES storage 0/2] fix #7280: lvm plugin: rename: activate qcow2 volume to read snapshot info
@ 2026-02-06 11:38 Fiona Ebner
  2026-02-06 11:38 ` [PATCH storage 1/2] " Fiona Ebner
  2026-02-06 11:38 ` [PATCH storage 2/2] lvm plugin: rename: improve error message Fiona Ebner
  0 siblings, 2 replies; 3+ messages in thread
From: Fiona Ebner @ 2026-02-06 11:38 UTC (permalink / raw)
  To: pve-devel

See patch 1/2 for more information.
Patch 2/2 just improves an error message.

Storage:

Fiona Ebner (2):
  fix #7280: lvm plugin: rename: activate qcow2 volume to read snapshot
    info
  lvm plugin: rename: improve error message

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


Summary over all repositories:
  1 files changed, 3 insertions(+), 1 deletions(-)

-- 
Generated by git-murpp 0.5.0




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

* [PATCH storage 1/2] fix #7280: lvm plugin: rename: activate qcow2 volume to read snapshot info
  2026-02-06 11:38 [PATCH-SERIES storage 0/2] fix #7280: lvm plugin: rename: activate qcow2 volume to read snapshot info Fiona Ebner
@ 2026-02-06 11:38 ` Fiona Ebner
  2026-02-06 11:38 ` [PATCH storage 2/2] lvm plugin: rename: improve error message Fiona Ebner
  1 sibling, 0 replies; 3+ messages in thread
From: Fiona Ebner @ 2026-02-06 11:38 UTC (permalink / raw)
  To: pve-devel

Other callers of volume_snapshot_info() already do this. For other
storages and formats, activation is not necessary to rename it, so the
activation is only added here, rather than in the qemu-server, and, for
consistency, container API endpoints.

There is no need for deactivation after the rename operation. In fact,
in case of reassign to a running target VM with SCSI or VirtIO block,
the renamed disk is even hotplugged, so deactivation would be wrong.

Note that the order of $scfg and $storeid really is switched when
comparing volume_snapshot_info() and activate_volume().

Technically, the check for snapshots would not be needed, as
reassigning a volume referenced in a snapshot is already prohibited by
the guest API endpoints. But additional checks on the storage layer
don't hurt and there might be other users of rename_volume() in the
future.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/Storage/LVMPlugin.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/PVE/Storage/LVMPlugin.pm b/src/PVE/Storage/LVMPlugin.pm
index 32a8339..f9349de 100644
--- a/src/PVE/Storage/LVMPlugin.pm
+++ b/src/PVE/Storage/LVMPlugin.pm
@@ -1439,6 +1439,7 @@ sub rename_volume {
     ) = $class->parse_volname($source_volname);
 
     if ($format eq 'qcow2') {
+        $class->activate_volume($storeid, $scfg, $source_volname);
         my $snapshots = $class->volume_snapshot_info($scfg, $storeid, $source_volname);
         die "we can't rename volume if external snapshot exists" if $snapshots->{current}->{parent};
     }
-- 
2.47.3





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

* [PATCH storage 2/2] lvm plugin: rename: improve error message
  2026-02-06 11:38 [PATCH-SERIES storage 0/2] fix #7280: lvm plugin: rename: activate qcow2 volume to read snapshot info Fiona Ebner
  2026-02-06 11:38 ` [PATCH storage 1/2] " Fiona Ebner
@ 2026-02-06 11:38 ` Fiona Ebner
  1 sibling, 0 replies; 3+ messages in thread
From: Fiona Ebner @ 2026-02-06 11:38 UTC (permalink / raw)
  To: pve-devel

Avoid the use of 'we', mention the volume in question and add a
newline.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/Storage/LVMPlugin.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/PVE/Storage/LVMPlugin.pm b/src/PVE/Storage/LVMPlugin.pm
index f9349de..8392c89 100644
--- a/src/PVE/Storage/LVMPlugin.pm
+++ b/src/PVE/Storage/LVMPlugin.pm
@@ -1441,7 +1441,8 @@ sub rename_volume {
     if ($format eq 'qcow2') {
         $class->activate_volume($storeid, $scfg, $source_volname);
         my $snapshots = $class->volume_snapshot_info($scfg, $storeid, $source_volname);
-        die "we can't rename volume if external snapshot exists" if $snapshots->{current}->{parent};
+        die "can't rename volume '$source_volname' - external snapshot exists\n"
+            if $snapshots->{current}->{parent};
     }
 
     $target_volname = $class->find_free_diskname($storeid, $scfg, $target_vmid, $format)
-- 
2.47.3





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

end of thread, other threads:[~2026-02-06 11:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-06 11:38 [PATCH-SERIES storage 0/2] fix #7280: lvm plugin: rename: activate qcow2 volume to read snapshot info Fiona Ebner
2026-02-06 11:38 ` [PATCH storage 1/2] " Fiona Ebner
2026-02-06 11:38 ` [PATCH storage 2/2] lvm plugin: rename: improve error message 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