From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 1516F1FF178 for ; Mon, 15 Dec 2025 12:27:22 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4B95194AA; Mon, 15 Dec 2025 12:28:05 +0100 (CET) Message-ID: <0be63547-f2f8-4e75-a420-838585f5d023@proxmox.com> Date: Mon, 15 Dec 2025 12:27:30 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Fiona Ebner To: pve-devel@lists.proxmox.com References: <20251203132949.109685-1-f.ebner@proxmox.com> <20251203132949.109685-8-f.ebner@proxmox.com> Content-Language: en-US In-Reply-To: <20251203132949.109685-8-f.ebner@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1765798044080 X-SPAM-LEVEL: Spam detection results: 0 AWL -1.016 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 KAM_MAILER 2 Automated Mailer Tag Left in Email SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH qemu-server 07/18] blockdev: switch get_node_name_below_throttle() to use QMP peer 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" Am 03.12.25 um 2:29 PM schrieb Fiona Ebner: > diff --git a/src/PVE/QemuServer/Blockdev.pm b/src/PVE/QemuServer/Blockdev.pm > index 36a0ea99..52875010 100644 > --- a/src/PVE/QemuServer/Blockdev.pm > +++ b/src/PVE/QemuServer/Blockdev.pm > @@ -161,12 +161,22 @@ sub top_node_name { > } > > sub get_node_name_below_throttle { > - my ($vmid, $device_id, $assert_top_is_throttle) = @_; > + my ($qmp_peer, $device_id, $assert_top_is_throttle) = @_; > > - my $block_info = get_block_info($vmid); > - my $drive_id = $device_id =~ s/^drive-//r; > - my $top = $block_info->{$drive_id}->{inserted} > - or die "no block node inserted for drive '$drive_id'\n"; > + my $top; > + if ($qmp_peer->{type} eq 'qmp') { # get_block_info() only works if there are front-end devices. > + my $block_info = get_block_info($qmp_peer->{id}); > + my $drive_id = $device_id =~ s/^drive-//r; > + $top = $block_info->{$drive_id}->{inserted} > + or die "no block node inserted for drive '$drive_id'\n"; > + } else { > + my $named_block_node_info = qmp_cmd($qmp_peer, 'query-named-block-nodes'); > + for my $info ($named_block_node_info->@*) { > + next if $info->{'node-name'} ne $device_id; > + $top = $info; > + last; > + } Since I had to look up this code for doing something similar, I now noticed that there should be a 'die' here if no $top can be found. > + } > > if ($top->{drv} ne 'throttle') { > die "$device_id: unexpected top node $top->{'node-name'} ($top->{drv})\n" _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel