public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Lukas Sichert <l.sichert@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Lukas Sichert <l.sichert@proxmox.com>
Subject: [PATCH storage 1/4] lvm: rename the saferemove throughput parser to parse_throughput
Date: Fri, 20 Nov 2026 14:32:40 +0100	[thread overview]
Message-ID: <20261120133245.51042-2-l.sichert@proxmox.com> (raw)
In-Reply-To: <20261120133245.51042-1-l.sichert@proxmox.com>

The parser only handles the value syntax of a throughput limit, so it
is not specific to saferemove.

Signed-off-by: Lukas Sichert <l.sichert@proxmox.com>
---
 src/PVE/Storage/LVMPlugin.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/PVE/Storage/LVMPlugin.pm b/src/PVE/Storage/LVMPlugin.pm
index c8384d7..3f74cfc 100644
--- a/src/PVE/Storage/LVMPlugin.pm
+++ b/src/PVE/Storage/LVMPlugin.pm
@@ -684,11 +684,11 @@ my sub blockdev_ioctl_range {
 
 # The limit is in bytes per second, with an optional k, m or g suffix for powers of 1024, as taken by
 # cstream's -t option, which existing configurations were written for.
-my sub parse_saferemove_throughput {
+my sub parse_throughput {
     my ($value) = @_;
 
     my ($number, $unit) = $value =~ m/^(-?\d+)([kmg])?$/i
-        or die "invalid saferemove throughput '$value'\n";
+        or die "invalid throughput '$value'\n";
     my $multiplier = { k => 1024, m => 1024**2, g => 1024**3 }->{ lc($unit // '') } // 1;
 
     return $number * $multiplier;
@@ -762,7 +762,7 @@ my sub free_lvm_volumes_locked {
         my $throughput = undef; # discards alone are not rate limited
         if ($zero_out && (my $value = $scfg->{saferemove_throughput})) {
             # Normalize zero spellings before selecting the default or dividing by the rate.
-            $throughput = abs(parse_saferemove_throughput($value)) || undef;
+            $throughput = abs(parse_throughput($value)) || undef;
         }
         if (defined($throughput)) {
             my $rendered_throughput = render_bytes($throughput);
-- 
2.47.3





  reply	other threads:[~2026-11-20 13:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 13:32 [PATCH docs/manager/storage 0/4] fix #8196: lvm: add a throughput limit for discards Lukas Sichert
2026-11-20 13:32 ` Lukas Sichert [this message]
2026-11-20 13:32 ` [PATCH storage 2/4] fix #8196: lvm: add discard throughput limit Lukas Sichert
2026-11-20 13:32 ` [PATCH manager 3/4] ui: lvm: keep other on-volume-remove options when editing Lukas Sichert
2026-11-20 13:32 ` [PATCH docs 4/4] storage: lvm: document the discard throughput limit Lukas Sichert

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=20261120133245.51042-2-l.sichert@proxmox.com \
    --to=l.sichert@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