From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id E9A7F1FF16F for ; Tue, 16 Sep 2025 14:34:57 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 3F57213A6B; Tue, 16 Sep 2025 14:35:10 +0200 (CEST) From: Filip Schauer To: pve-devel@lists.proxmox.com Date: Tue, 16 Sep 2025 14:32:47 +0200 Message-ID: <20250916123257.107491-3-f.schauer@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250916123257.107491-1-f.schauer@proxmox.com> References: <20250916123257.107491-1-f.schauer@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1758026070290 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.008 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH storage v8 2/9] storage migrate: avoid ssh when moving a volume locally X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Avoid the overhead of SSH when $target_sshinfo is undefined. Instead move a volume between storages on the same node. Signed-off-by: Filip Schauer --- src/PVE/Storage.pm | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/PVE/Storage.pm b/src/PVE/Storage.pm index fca308a..3467a90 100755 --- a/src/PVE/Storage.pm +++ b/src/PVE/Storage.pm @@ -940,10 +940,6 @@ sub storage_migrate { my $target_volid = "${target_storeid}:${target_volname}"; - my $target_ip = $target_sshinfo->{ip}; - - my $ssh = PVE::SSHInfo::ssh_info_to_command($target_sshinfo); - if (!defined($opts->{snapshot})) { $opts->{migration_snapshot} = storage_migrate_snapshot($cfg, $storeid, $opts->{with_snapshots}); @@ -962,13 +958,19 @@ sub storage_migrate { my $format = $formats[0]; my $import_fn = '-'; # let pvesm import read from stdin per default - if ($insecure) { - my $net = $target_sshinfo->{network} // $target_sshinfo->{ip}; - $import_fn = "tcp://$net"; + my $recv = []; + + if (defined($target_sshinfo)) { + if ($insecure) { + my $net = $target_sshinfo->{network} // $target_sshinfo->{ip}; + $import_fn = "tcp://$net"; + } + + my $ssh = PVE::SSHInfo::ssh_info_to_command($target_sshinfo); + push @$recv, (@$ssh, '--'); } - my $recv = - [@$ssh, '--', $volume_import_prepare->($target_volid, $format, $import_fn, $opts)->@*]; + push @$recv, ($volume_import_prepare->($target_volid, $format, $import_fn, $opts)->@*); my $new_volid; my $pattern = volume_imported_message(undef, 1); -- 2.47.3 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel