adapt to volume_support_qemu_snapshot -> volume_qemu_snapshot_method

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2025-07-16 15:34:31 +02:00
parent 0e2b084e00
commit 6481e92e94
3 changed files with 9 additions and 9 deletions

View file

@ -7638,11 +7638,11 @@ sub do_snapshots_type {
#we use storage snapshot if vm is not running or if disk is unused;
return 'storage' if !$running || !$deviceid;
my $qemu_snapshot_type = PVE::Storage::volume_support_qemu_snapshot($storecfg, $volid);
# if running, but don't support qemu snapshot, we use storage snapshot
return 'storage' if !$qemu_snapshot_type;
return $qemu_snapshot_type;
if (my $method = PVE::Storage::volume_qemu_snapshot_method($storecfg, $volid)) {
return 'internal' if $method eq 'qemu';
return 'external' if $method eq 'mixed';
}
return 'storage';
}
=head3 template_create($vmid, $conf [, $disk])

View file

@ -430,8 +430,8 @@ sub generate_drive_blockdev {
$child = generate_format_blockdev($storecfg, $drive, $child, $options);
my $support_qemu_snapshots =
PVE::Storage::volume_support_qemu_snapshot($storecfg, $drive->{file});
if ($support_qemu_snapshots && $support_qemu_snapshots eq 'external') {
PVE::Storage::volume_qemu_snapshot_method($storecfg, $drive->{file});
if ($support_qemu_snapshots && $support_qemu_snapshots eq 'mixed') {
my $backing_chain = generate_backing_chain_blockdev(
$storecfg, "drive-$drive_id", $drive, $machine_version,
);

View file

@ -71,7 +71,7 @@ sub 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 $support_qemu_snapshots = PVE::Storage::volume_support_qemu_snapshot($storecfg, $src_volid);
my $support_qemu_snapshots = PVE::Storage::volume_qemu_snapshot_method($storecfg, $src_volid);
my $cmd = [];
push @$cmd, '/usr/bin/qemu-img', 'convert', '-p', '-n';
@ -79,7 +79,7 @@ sub convert {
if $snapname
&& $src_format eq 'qcow2'
&& $support_qemu_snapshots
&& $support_qemu_snapshots eq 'internal';
&& $support_qemu_snapshots eq 'qemu';
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);