--- Begin Message ---
Signed-off-by: Alexandre Derumier <alexandre.derum...@groupe-cyllene.com>
---
 src/PVE/API2/Qemu.pm | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm
index 2e6358e4..dbc08737 100644
--- a/src/PVE/API2/Qemu.pm
+++ b/src/PVE/API2/Qemu.pm
@@ -4677,11 +4677,8 @@ __PACKAGE__->register_method({
             die "you can't move a cdrom\n" if 
PVE::QemuServer::drive_is_cdrom($drive, 1);
 
             my $old_volid = $drive->{file};
-            my $oldfmt;
             my ($oldstoreid, $oldvolname) = 
PVE::Storage::parse_volume_id($old_volid);
-            if ($oldvolname =~ m/\.(raw|qcow2|vmdk)$/) {
-                $oldfmt = $1;
-            }
+            my $oldfmt = (PVE::Storage::parse_volname($storecfg, 
$old_volid))[6];
 
             die "you can't move to the same storage with same format\n"
                 if $oldstoreid eq $storeid && (!$format || !$oldfmt || $oldfmt 
eq $format);
-- 
2.39.5



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

Reply via email to