From 4ef8ab60f6e375f222dd1d8e743582504a94738a Mon Sep 17 00:00:00 2001 From: Alexandre Derumier Date: Wed, 16 Jul 2025 08:31:52 +0200 Subject: [PATCH] lvmplugin: add external-snapshots option && forbid creation of qcow2 volumes without it Signed-off-by: Alexandre Derumier --- src/PVE/Storage/LVMPlugin.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/PVE/Storage/LVMPlugin.pm b/src/PVE/Storage/LVMPlugin.pm index 6e77eb3..1f5a5f1 100644 --- a/src/PVE/Storage/LVMPlugin.pm +++ b/src/PVE/Storage/LVMPlugin.pm @@ -399,6 +399,7 @@ sub options { base => { fixed => 1, optional => 1 }, tagged_only => { optional => 1 }, bwlimit => { optional => 1 }, + 'external-snapshots' => { optional => 1 }, }; } @@ -603,6 +604,10 @@ my sub alloc_lvm_image { die "unsupported format '$fmt'" if $fmt ne 'raw' && $fmt ne 'qcow2'; + die "external-snapshots option need to be enabled to use qcow2 format" + if $fmt eq 'qcow2' + && !$scfg->{'external-snapshots'}; + $class->parse_volname($name); my $vgs = lvm_vgs();