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 119AC1FF13B for ; Wed, 22 Apr 2026 13:14:17 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5294716C3F; Wed, 22 Apr 2026 13:13:53 +0200 (CEST) From: "Max R. Carrara" To: pve-devel@lists.proxmox.com Subject: [PATCH pve-storage v1 13/54] storage: update code style in function path_to_volume_id Date: Wed, 22 Apr 2026 13:12:39 +0200 Message-ID: <20260422111322.257380-14-m.carrara@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260422111322.257380-1-m.carrara@proxmox.com> References: <20260422111322.257380-1-m.carrara@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1776856328984 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.085 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 Message-ID-Hash: I3KIVFZUAKOASHBHAGJTJFN5SGUGNDJ5 X-Message-ID-Hash: I3KIVFZUAKOASHBHAGJTJFN5SGUGNDJ5 X-MailFrom: m.carrara@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Also rename the initially parsed storeid from `$sid` to `$parsed_storeid`. Signed-off-by: Max R. Carrara --- src/PVE/Storage.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/PVE/Storage.pm b/src/PVE/Storage.pm index ef2e7887..70844602 100755 --- a/src/PVE/Storage.pm +++ b/src/PVE/Storage.pm @@ -696,9 +696,9 @@ sub path_to_volume_id { my $ids = $cfg->{ids}; - my ($sid, $volname) = parse_volume_id($path, 1); - if ($sid) { - if (my $scfg = $ids->{$sid}) { + my ($parsed_storeid, $volname) = parse_volume_id($path, 1); + if ($parsed_storeid) { + if (my $scfg = $ids->{$parsed_storeid}) { if ($scfg->{path}) { my $plugin = PVE::Storage::Plugin->lookup($scfg->{type}); my ($vtype, $name, $vmid) = $plugin->parse_volname($volname); @@ -712,7 +712,7 @@ sub path_to_volume_id { # for example when nfs storage is not mounted $path = abs_path($path) || $path; - foreach my $sid (keys %$ids) { + for my $sid (keys $ids->%*) { my $scfg = $ids->{$sid}; next if !$scfg->{path}; my $plugin = PVE::Storage::Plugin->lookup($scfg->{type}); @@ -728,7 +728,7 @@ sub path_to_volume_id { my $name = $2; my $vollist = $plugin->list_images($sid, $scfg, $vmid); - foreach my $info (@$vollist) { + for my $info ($vollist->@*) { my ($storeid, $volname) = parse_volume_id($info->{volid}); my $volpath = $plugin->path($scfg, $volname, $storeid); if ($volpath eq $path) { -- 2.47.3