all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH qemu-server v2 06/18] blockdev: rename variable in get_node_name_below_throttle() for readability
Date: Mon,  9 Mar 2026 17:58:32 +0100	[thread overview]
Message-ID: <20260309165913.219308-7-f.ebner@proxmox.com> (raw)
In-Reply-To: <20260309165913.219308-1-f.ebner@proxmox.com>

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>
---
 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





  parent reply	other threads:[~2026-03-09 17:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-09 16:58 [PATCH-SERIES qemu-server v2 00/18] fix #7066: api: allow live snapshot (remove) of qcow2 TPM drive with snapshot-as-volume-chain Fiona Ebner
2026-03-09 16:58 ` [PATCH qemu-server v2 01/18] block job: fix variable name in documentation Fiona Ebner
2026-03-09 16:58 ` [PATCH qemu-server v2 02/18] qmp client: add default timeouts for more block commands Fiona Ebner
2026-03-09 16:58 ` [PATCH qemu-server v2 03/18] drive: introduce drive_uses_qsd_fuse() helper Fiona Ebner
2026-03-09 16:58 ` [PATCH qemu-server v2 04/18] monitor: add vm_qmp_peer() helper Fiona Ebner
2026-03-09 16:58 ` [PATCH qemu-server v2 05/18] monitor: add qsd_peer() helper Fiona Ebner
2026-03-09 16:58 ` Fiona Ebner [this message]
2026-03-09 16:58 ` [PATCH qemu-server v2 07/18] blockdev: switch get_node_name_below_throttle() to use QMP peer Fiona Ebner
2026-03-09 16:58 ` [PATCH qemu-server v2 08/18] blockdev: switch detach() " Fiona Ebner
2026-03-09 16:58 ` [PATCH qemu-server v2 09/18] blockdev: switch blockdev_replace() " Fiona Ebner
2026-03-09 16:58 ` [PATCH qemu-server v2 10/18] blockdev: switch blockdev_external_snapshot() " Fiona Ebner
2026-03-09 16:58 ` [PATCH qemu-server v2 11/18] block job: switch qemu_handle_concluded_blockjob() " Fiona Ebner
2026-03-09 16:58 ` [PATCH qemu-server v2 12/18] block job: switch qemu_blockjobs_cancel() " Fiona Ebner
2026-03-09 16:58 ` [PATCH qemu-server v2 13/18] block job: switch qemu_drive_mirror_monitor() " Fiona Ebner
2026-03-09 16:58 ` [PATCH qemu-server v2 14/18] blockdev: switch blockdev_delete() " Fiona Ebner
2026-03-09 16:58 ` [PATCH qemu-server v2 15/18] blockdev: switch blockdev_stream() " Fiona Ebner
2026-03-09 16:58 ` [PATCH qemu-server v2 16/18] blockdev: switch blockdev_commit() " Fiona Ebner
2026-03-09 16:58 ` [PATCH qemu-server v2 17/18] snapshot: support live snapshot (remove) of qcow2 TPM drive on storage with snapshot-as-volume-chain Fiona Ebner
2026-03-09 16:58 ` [PATCH qemu-server v2 18/18] fix #7066: api: allow live snapshot (remove) of qcow2 TPM drive " Fiona Ebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260309165913.219308-7-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal