all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH storage 1/1] zfs: volume import: use correct format for renaming
Date: Thu,  3 Mar 2022 13:31:21 +0100	[thread overview]
Message-ID: <20220303123121.109758-4-f.ebner@proxmox.com> (raw)
In-Reply-To: <20220303123121.109758-1-f.ebner@proxmox.com>

Previously, the transport format (which currently is always 'zfs') was
passed in, resulting in subvol-disks not to be renamed correctly.

Fixes: a97d3ee ("Introduce allow_rename parameter for pvesm import and storage_migrate")
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
 PVE/Storage/ZFSPoolPlugin.pm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm
index e952a5c..343f833 100644
--- a/PVE/Storage/ZFSPoolPlugin.pm
+++ b/PVE/Storage/ZFSPoolPlugin.pm
@@ -770,7 +770,9 @@ sub volume_import {
     die "internal error: invalid file handle for volume_import\n"
 	if !defined($fd);
 
-    my (undef, $dataset, $vmid) = $class->parse_volname($volname);
+    my (undef, $dataset, $vmid, undef, undef, undef, $volume_format) =
+	$class->parse_volname($volname);
+
     my $zfspath = "$scfg->{pool}/$dataset";
     my $suffix = defined($base_snapshot) ? "\@$base_snapshot" : '';
     my $exists = 0 == run_command(['zfs', 'get', '-H', 'name', $zfspath.$suffix],
@@ -780,7 +782,7 @@ sub volume_import {
     } elsif ($exists) {
 	die "volume '$zfspath' already exists\n" if !$allow_rename;
 	warn "volume '$zfspath' already exists - importing with a different name\n";
-	$dataset = $class->find_free_diskname($storeid, $scfg, $vmid, $format);
+	$dataset = $class->find_free_diskname($storeid, $scfg, $vmid, $volume_format);
 	$zfspath = "$scfg->{pool}/$dataset";
     }
 
-- 
2.30.2





  parent reply	other threads:[~2022-03-03 12:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-03 12:31 [pve-devel] [PATCH-SERIES container/storage] migration fixes for containers Fabian Ebner
2022-03-03 12:31 ` [pve-devel] [PATCH container 1/2] migrate: also set targetsid for unreferenced disks Fabian Ebner
2022-03-03 12:31 ` [pve-devel] [PATCH container 2/2] config: print volume: support printing unused volume Fabian Ebner
2022-03-03 12:31 ` Fabian Ebner [this message]
2022-03-03 13:40 ` [pve-devel] applied series: [PATCH-SERIES container/storage] migration fixes for containers Wolfgang Bumiller

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=20220303123121.109758-4-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.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