all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server] print drive commandline: prohibit using snapshot-as-volume-chain qcow2 images
@ 2025-08-11 13:51 Fiona Ebner
  2025-08-12 10:23 ` [pve-devel] applied: " Fabian Grünbichler
  0 siblings, 1 reply; 2+ messages in thread
From: Fiona Ebner @ 2025-08-11 13:51 UTC (permalink / raw)
  To: pve-devel

Require that snapshot-as-volume-chain qcow2 images are always used in
combination with '-blockdev', rather than '-drive'. With '-drive', the
'discard-no-unref' option is not set and the fragmentation can lead to
the same issue that for '-blockdev', was solved by commit a3a9a2ab
("fix #6543: use qcow2 'discard-no-unref' option when using
snapshot-as-volume-chain").

While it would be possible to set the flag for '-drive' too, the
snapshot-as-volume-chain feature already only works with machine type
>= 10.0, see commit 6b2b45fd ("snapshot create/delete: die early for
snapshot-as-volume-chain for pre-10.0 machine version") and it's only
tested for those. Avoid accidents and other unknown issues by being
strict and prohibiting usage without '-blockdev'.

Reported-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/QemuServer.pm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index e30b27cb..cfc54568 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -1335,6 +1335,13 @@ sub print_drive_commandline_full {
     my ($path, $format) =
         PVE::QemuServer::Drive::get_path_and_format($storecfg, $drive, $live_restore_name);
 
+    if ($scfg && $scfg->{'snapshot-as-volume-chain'} && $format && $format eq 'qcow2') {
+        # the print_drive_commandline_full() function is only used if machine version is < 10.0
+        die "storage for '$drive->{file}' is configured for snapshots as a volume chain - this"
+            . " requires QEMU machine version >= 10.0. See"
+            . " https://pve.proxmox.com/wiki/QEMU_Machine_Version_Upgrade\n";
+    }
+
     my $is_rbd = $path =~ m/^rbd:/;
 
     my $opts = '';
-- 
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] 2+ messages in thread

* [pve-devel] applied: [PATCH qemu-server] print drive commandline: prohibit using snapshot-as-volume-chain qcow2 images
  2025-08-11 13:51 [pve-devel] [PATCH qemu-server] print drive commandline: prohibit using snapshot-as-volume-chain qcow2 images Fiona Ebner
@ 2025-08-12 10:23 ` Fabian Grünbichler
  0 siblings, 0 replies; 2+ messages in thread
From: Fabian Grünbichler @ 2025-08-12 10:23 UTC (permalink / raw)
  To: pve-devel, Fiona Ebner


On Mon, 11 Aug 2025 15:51:33 +0200, Fiona Ebner wrote:
> Require that snapshot-as-volume-chain qcow2 images are always used in
> combination with '-blockdev', rather than '-drive'. With '-drive', the
> 'discard-no-unref' option is not set and the fragmentation can lead to
> the same issue that for '-blockdev', was solved by commit a3a9a2ab
> ("fix #6543: use qcow2 'discard-no-unref' option when using
> snapshot-as-volume-chain").
> 
> [...]

Applied, thanks!

[1/1] print drive commandline: prohibit using snapshot-as-volume-chain qcow2 images
      (no commit info)

Best regards,
-- 
Fabian Grünbichler <f.gruenbichler@proxmox.com>


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

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-11 13:51 [pve-devel] [PATCH qemu-server] print drive commandline: prohibit using snapshot-as-volume-chain qcow2 images Fiona Ebner
2025-08-12 10:23 ` [pve-devel] applied: " Fabian Grünbichler

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