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 434DB1FF183 for ; Wed, 3 Dec 2025 14:31:02 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D2441A1EC; Wed, 3 Dec 2025 14:30:29 +0100 (CET) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Wed, 3 Dec 2025 14:26:32 +0100 Message-ID: <20251203132949.109685-7-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251203132949.109685-1-f.ebner@proxmox.com> References: <20251203132949.109685-1-f.ebner@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1764768548664 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.017 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 qemu-server 06/18] blockdev: rename variable in get_node_name_below_throttle() for readability 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" 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 --- 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 966bbc0d..36a0ea99 100644 --- a/src/PVE/QemuServer/Blockdev.pm +++ b/src/PVE/QemuServer/Blockdev.pm @@ -165,17 +165,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 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel