[PATCH qemu-server 12/14] qemu_img convert : add external snapshot support
Alexandre Derumier
alexandre.derumier at groupe-cyllene.com
Tue Apr 22 13:51:39 CEST 2025
for external snapshot, we simply use snap volname as src.
don't use internal snapshot option in the command line.
Signed-off-by: Alexandre Derumier <alexandre.derumier at groupe-cyllene.com>
---
PVE/QemuServer.pm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 12d60cad..5cce7094 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -7906,11 +7906,11 @@ sub qemu_img_convert {
my $dst_format = checked_volume_format($storecfg, $dst_volid);
my $dst_path = PVE::Storage::path($storecfg, $dst_volid);
my $dst_is_iscsi = ($dst_path =~ m|^iscsi://|);
+ my $snapshot_type = PVE::Storage::volume_has_feature($storecfg, 'snapshot', $src_volid);
my $cmd = [];
push @$cmd, '/usr/bin/qemu-img', 'convert', '-p', '-n';
- push @$cmd, '-l', "snapshot.name=$snapname"
- if $snapname && $src_format && $src_format eq "qcow2";
+ push @$cmd, '-l', "snapshot.name=$snapname" if $snapname && $snapshot_type == 2;
push @$cmd, '-t', 'none' if $dst_scfg->{type} eq 'zfspool';
push @$cmd, '-T', $cachemode if defined($cachemode);
push @$cmd, '-r', "${bwlimit}K" if defined($bwlimit);
--
2.39.5
More information about the pve-devel
mailing list