In preparation for the restore API for backup providers that doesn't
want detection based on the file extension but always requires raw.

Signed-off-by: Fiona Ebner <f.eb...@proxmox.com>
---

New in v6.

 PVE/QemuServer.pm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 5c6cb94a..93f985be 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -7791,6 +7791,8 @@ sub convert_iscsi_path {
 # bwlimit - The bandwidth limit in KiB/s.
 # is-zero-initialized - If the destination image is zero-initialized.
 # snapname - Use this snapshot of the source image.
+# source-path-format - Indicate the format of the source when the source is a 
path. For PVE-managed
+# volumes, the format from the storage layer is always used.
 sub qemu_img_convert {
     my ($src_volid, $dst_volid, $size, $opts) = @_;
 
@@ -7816,7 +7818,9 @@ sub qemu_img_convert {
        $cachemode = 'none' if $src_scfg->{type} eq 'zfspool';
     } elsif (-f $src_volid || -b $src_volid) {
        $src_path = $src_volid;
-       if ($src_path =~ m/\.($PVE::QemuServer::Drive::QEMU_FORMAT_RE)$/) {
+       if ($opts->{'source-path-format'}) {
+           $src_format = $opts->{'source-path-format'};
+       } elsif ($src_path =~ m/\.($PVE::QemuServer::Drive::QEMU_FORMAT_RE)$/) {
            $src_format = $1;
        }
     }
-- 
2.39.5



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

Reply via email to