[PATCH qemu-server v4 06/18] blockdev: rename variable in get_node_name_below_throttle() for readability

Fiona Ebner
2026-04-24T11:47:48Z

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 <f.ebner@proxmox.com>
Tested-by: Lukas Sichert <l.sichert@proxmox.com>
---
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