mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-03 08:20:04 +00:00
fixes for qemu_block_set_io_throttle
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
parent
522c8f97d7
commit
f3f323a3fc
@ -2601,6 +2601,8 @@ sub qemu_netdevdel {
|
||||
sub qemu_block_set_io_throttle {
|
||||
my ($vmid, $deviceid, $bps, $bps_rd, $bps_wr, $iops, $iops_rd, $iops_wr) = @_;
|
||||
|
||||
return if !check_running($vmid) ;
|
||||
|
||||
$bps = 0 if !$bps;
|
||||
$bps_rd = 0 if !$bps_rd;
|
||||
$bps_wr = 0 if !$bps_wr;
|
||||
@ -2608,11 +2610,8 @@ sub qemu_block_set_io_throttle {
|
||||
$iops_rd = 0 if !$iops_rd;
|
||||
$iops_wr = 0 if !$iops_wr;
|
||||
|
||||
my $ret = vm_mon_cmd($vmid, "block_set_io_throttle", device => $deviceid, bps => $bps, bps_rd => $bps_rd, bps_wr => $bps_wr, iops => $iops, iops_rd => $iops_rd, iops_wr => $iops_wr);
|
||||
$ret =~ s/^\s+//;
|
||||
return 1 if $ret eq "";
|
||||
syslog("err", "error setting block_set_io_throttle: $ret");
|
||||
return undef;
|
||||
vm_mon_cmd($vmid, "block_set_io_throttle", device => $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));
|
||||
|
||||
}
|
||||
|
||||
sub vm_start {
|
||||
|
Loading…
Reference in New Issue
Block a user