[pve-devel] [PATCH qemu-server v3 21/51] blockdev: add and use throttle_group_id() helper

Fiona Ebner f.ebner at proxmox.com
Wed Jul 2 18:27:54 CEST 2025


Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 src/PVE/QemuServer/Blockdev.pm | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/PVE/QemuServer/Blockdev.pm b/src/PVE/QemuServer/Blockdev.pm
index 6e6b9245..3caae362 100644
--- a/src/PVE/QemuServer/Blockdev.pm
+++ b/src/PVE/QemuServer/Blockdev.pm
@@ -39,6 +39,12 @@ my sub read_only_json_option {
     return json_bool($drive->{ro} || drive_is_cdrom($drive) || $options->{'read-only'});
 }
 
+my sub throttle_group_id {
+    my ($drive_id) = @_;
+
+    return "throttle-drive-$drive_id";
+}
+
 sub generate_throttle_group {
     my ($drive) = @_;
 
@@ -69,7 +75,7 @@ sub generate_throttle_group {
     }
 
     return {
-        id => "throttle-drive-$drive_id",
+        id => throttle_group_id($drive_id),
         limits => $limits,
         'qom-type' => 'throttle-group',
     };
@@ -216,7 +222,7 @@ sub generate_drive_blockdev {
     return {
         driver => "throttle",
         'node-name' => "drive-$drive_id",
-        'throttle-group' => "throttle-drive-$drive_id",
+        'throttle-group' => throttle_group_id($drive_id),
         file => $child,
     };
 }
-- 
2.47.2





More information about the pve-devel mailing list