all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Alexandre Derumier via pve-devel <pve-devel@lists.proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
Subject: [pve-devel] [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	[thread overview]
Message-ID: <mailman.1384.1752557289.395.pve-devel@lists.proxmox.com> (raw)

[-- 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

                 reply	other threads:[~2025-07-15  5:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mailman.1384.1752557289.395.pve-devel@lists.proxmox.com \
    --to=pve-devel@lists.proxmox.com \
    --cc=alexandre.derumier@groupe-cyllene.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal