--- Begin Message ---
Signed-off-by: Alexandre Derumier <alexandre.derum...@groupe-cyllene.com>
---
 PVE/QemuServer.pm | 49 ++++++++++++++++++++++++++---------------------
 1 file changed, 27 insertions(+), 22 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index f12e27f2..11bdc9ff 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -4448,7 +4448,7 @@ sub qemu_cpu_hotplug {
     }
 }
 
-sub qemu_block_set_io_throttle {
+sub qemu_blockdev_set_throttle_limits {
     my ($vmid, $deviceid,
        $bps, $bps_rd, $bps_wr, $iops, $iops_rd, $iops_wr,
        $bps_max, $bps_rd_max, $bps_wr_max, $iops_max, $iops_rd_max, 
$iops_wr_max,
@@ -4457,27 +4457,32 @@ sub qemu_block_set_io_throttle {
 
     return if !check_running($vmid) ;
 
-    mon_cmd($vmid, "block_set_io_throttle", id => $deviceid,
-       bps => int($bps),
-       bps_rd => int($bps_rd),
-       bps_wr => int($bps_wr),
-       iops => int($iops),
-       iops_rd => int($iops_rd),
-       iops_wr => int($iops_wr),
-       bps_max => int($bps_max),
-       bps_rd_max => int($bps_rd_max),
-       bps_wr_max => int($bps_wr_max),
-       iops_max => int($iops_max),
-       iops_rd_max => int($iops_rd_max),
-       iops_wr_max => int($iops_wr_max),
-       bps_max_length => int($bps_max_length),
-       bps_rd_max_length => int($bps_rd_max_length),
-       bps_wr_max_length => int($bps_wr_max_length),
-       iops_max_length => int($iops_max_length),
-       iops_rd_max_length => int($iops_rd_max_length),
-       iops_wr_max_length => int($iops_wr_max_length),
+    mon_cmd(
+       $vmid,
+       'qom-set',
+       path => "throttle-$deviceid",
+       property => "limits",
+       value => {
+           'bps-total' => int($bps),
+           'bps-read' => int($bps_rd),
+           'bps-write' => int($bps_wr),
+           'iops-total' => int($iops),
+           'iops-read' => int($iops_rd),
+           'iops-write' => int($iops_wr),
+           'bps-total-max' => int($bps_max),
+           'bps-read-max' => int($bps_rd_max),
+           'bps-write-max' => int($bps_wr_max),
+           'iops-total-max' => int($iops_max),
+           'iops-read-max' => int($iops_rd_max),
+           'iops-write-max' => int($iops_wr_max),
+           'bps-total-max-length' => int($bps_max_length),
+           'bps-read-max-length' => int($bps_rd_max_length),
+           'bps-write-max-length' => int($bps_wr_max_length),
+           'iops-total-max-length' => int($iops_max_length),
+           'iops-read-max-length' => int($iops_rd_max_length),
+           'iops-write-max-length' => int($iops_wr_max_length),
+       }
     );
-
 }
 
 sub qemu_block_resize {
@@ -5239,7 +5244,7 @@ sub vmconfig_update_disk {
                    safe_num_ne($drive->{iops_rd_max_length}, 
$old_drive->{iops_rd_max_length}) ||
                    safe_num_ne($drive->{iops_wr_max_length}, 
$old_drive->{iops_wr_max_length})) {
 
-                   qemu_block_set_io_throttle(
+                   qemu_blockdev_set_throttle_limits(
                        $vmid,"drive-$opt",
                        ($drive->{mbps} || 0)*1024*1024,
                        ($drive->{mbps_rd} || 0)*1024*1024,
-- 
2.39.5



--- End Message ---
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to