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 889C41FF140 for ; Fri, 24 Apr 2026 13:47:48 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 19BCE15CAB; Fri, 24 Apr 2026 13:47:40 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server v4 06/18] blockdev: rename variable in get_node_name_below_throttle() for readability Date: Fri, 24 Apr 2026 13:46:40 +0200 Message-ID: <20260424114722.107671-7-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260424114722.107671-1-f.ebner@proxmox.com> References: <20260424114722.107671-1-f.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1777031164305 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 Message-ID-Hash: 3GWDYBE24CUSP7EZRZIPHWEOAUM7KRPA X-Message-ID-Hash: 3GWDYBE24CUSP7EZRZIPHWEOAUM7KRPA X-MailFrom: f.ebner@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: The inserted node for the front-end device queried via get_block_info() is the top node. The next commit will allow get_node_name_below_throttle() to also query QSD, where there is no front-end device. Part of the code can still be re-used, but the name 'inserted' would just be confusing. Signed-off-by: Fiona Ebner Tested-by: Lukas Sichert --- src/PVE/QemuServer/Blockdev.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/PVE/QemuServer/Blockdev.pm b/src/PVE/QemuServer/Blockdev.pm index 3c27e721..c96b76da 100644 --- a/src/PVE/QemuServer/Blockdev.pm +++ b/src/PVE/QemuServer/Blockdev.pm @@ -170,17 +170,17 @@ sub get_node_name_below_throttle { my $block_info = get_block_info($vmid); my $drive_id = $device_id =~ s/^drive-//r; - my $inserted = $block_info->{$drive_id}->{inserted} + my $top = $block_info->{$drive_id}->{inserted} or die "no block node inserted for drive '$drive_id'\n"; - if ($inserted->{drv} ne 'throttle') { - die "$device_id: unexpected top node $inserted->{'node-name'} ($inserted->{drv})\n" + if ($top->{drv} ne 'throttle') { + die "$device_id: unexpected top node $top->{'node-name'} ($top->{drv})\n" if $assert_top_is_throttle; # before the switch to -blockdev, the top node was not throttle - return $inserted->{'node-name'}; + return $top->{'node-name'}; } - my $children = { map { $_->{child} => $_ } $inserted->{children}->@* }; + my $children = { map { $_->{child} => $_ } $top->{children}->@* }; if (my $node_name = $children->{file}->{'node-name'}) { return $node_name; -- 2.47.3