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 <[email protected]> --- 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 [email protected] https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
