* [pve-devel] [PATCH FOLLOW-UP qemu-server 1/1] api2: move_disk: use parse_volname to find old volume format
@ 2025-07-15 5:27 Alexandre Derumier via pve-devel
0 siblings, 0 replies; only message in thread
From: Alexandre Derumier via pve-devel @ 2025-07-15 5:27 UTC (permalink / raw)
To: pve-devel; +Cc: Alexandre Derumier
[-- Attachment #1: Type: message/rfc822, Size: 3561 bytes --]
From: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH FOLLOW-UP qemu-server 1/1] api2: move_disk: use parse_volname to find old volume format
Date: Tue, 15 Jul 2025 07:27:36 +0200
Message-ID: <20250715052736.1182406-1-alexandre.derumier@groupe-cyllene.com>
Signed-off-by: Alexandre Derumier <alexandre.derumier@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
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-07-15 5:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-15 5:27 [pve-devel] [PATCH FOLLOW-UP qemu-server 1/1] api2: move_disk: use parse_volname to find old volume format Alexandre Derumier via pve-devel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox