public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Erik Fastermann <e.fastermann@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Erik Fastermann <e.fastermann@proxmox.com>
Subject: [PATCH qemu-server v3 2/6] drive: fix conversion of bps throttle limits to mbps
Date: Fri, 16 Oct 2026 14:25:58 +0200	[thread overview]
Message-ID: <20261016122602.183911-3-e.fastermann@proxmox.com> (raw)
In-Reply-To: <20261016122602.183911-1-e.fastermann@proxmox.com>

When translating the bps, bps_rd and bps_wr options to their mbps
counterparts, parse_drive stored the result of defined() instead of
the value itself. Any limit set this way thus became 0 mbps, which
QEMU treats as unlimited, so the limit was silently ignored.

The web UI only uses the mbps options, so only users setting the bps
options via the API or CLI are affected.

Signed-off-by: Erik Fastermann <e.fastermann@proxmox.com>
---
 src/PVE/QemuServer/Drive.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/QemuServer/Drive.pm b/src/PVE/QemuServer/Drive.pm
index 0b573717..bccf0371 100644
--- a/src/PVE/QemuServer/Drive.pm
+++ b/src/PVE/QemuServer/Drive.pm
@@ -867,7 +867,7 @@ sub parse_drive {
 
     my $error = 0;
     foreach my $opt (qw(bps bps_rd bps_wr)) {
-        if (my $bps = defined(delete $res->{$opt})) {
+        if (defined(my $bps = delete $res->{$opt})) {
             if (defined($res->{"m$opt"})) {
                 warn "both $opt and m$opt specified\n";
                 ++$error;
-- 
2.47.3





  parent reply	other threads:[~2026-10-16 12:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 12:25 [PATCH docs/manager/qemu-server v3 0/6] partially fix #1989: add QEMU qcow2 cache options Erik Fastermann
2026-10-16 12:25 ` [PATCH qemu-server v3 1/6] re-tidy source code Erik Fastermann
2026-10-16 12:25 ` Erik Fastermann [this message]
2026-10-16 12:25 ` [PATCH qemu-server v3 3/6] api: report why drive options are rejected Erik Fastermann
2026-10-16 12:26 ` [PATCH qemu-server v3 4/6] partially fix #1989: disk: add qcow2 cache options Erik Fastermann
2026-10-16 12:26 ` [PATCH pve-manager v3 5/6] partially fix #1989: ui: qemu: disk: add qcow2 cache size config Erik Fastermann
2026-10-16 12:26 ` [PATCH pve-docs v3 6/6] partially fix #1989: qm: document " Erik Fastermann

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=20261016122602.183911-3-e.fastermann@proxmox.com \
    --to=e.fastermann@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal