public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com, pve-devel@lists.proxmox.com
Subject: [PATCH pve-qemu 7/8] fix #7530: pbs-restore: expose optional rate limit parameters
Date: Tue, 25 Aug 2026 11:17:39 +0200	[thread overview]
Message-ID: <20260825091741.162883-8-c.ebner@proxmox.com> (raw)
In-Reply-To: <20260825091741.162883-1-c.ebner@proxmox.com>

Implements the flags to impose download and output data stream rate
limits for pbs-restore.

Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=7530
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
 ...se-optional-parameters-imposing-band.patch | 78 +++++++++++++++++++
 debian/patches/series                         |  1 +
 2 files changed, 79 insertions(+)
 create mode 100644 debian/patches/pve/0048-pbs-restore-expose-optional-parameters-imposing-band.patch

diff --git a/debian/patches/pve/0048-pbs-restore-expose-optional-parameters-imposing-band.patch b/debian/patches/pve/0048-pbs-restore-expose-optional-parameters-imposing-band.patch
new file mode 100644
index 0000000..3da909b
--- /dev/null
+++ b/debian/patches/pve/0048-pbs-restore-expose-optional-parameters-imposing-band.patch
@@ -0,0 +1,78 @@
+From 1e3bcc67823dccbab2d48f874598525502f78f97 Mon Sep 17 00:00:00 2001
+From: Christian Ebner <c.ebner@proxmox.com>
+Date: Mon, 24 Aug 2026 14:40:52 +0200
+Subject: [PATCH] pbs-restore: expose optional parameters imposing bandwidth
+ rate limits
+
+Exposes `bwlimit` and `rate-limit` as newly added optional parameters.
+
+This parameters are now exposes in the proxmox-backup-qemu lib's API
+function and allow to impose bandwidth limits on download by using
+`bwlimit` or output chunk data stream via the `rate-limit`.
+
+The former limits the http client download stream, not taking chunk
+compression and zero chunks into account, while the latter limits the
+output stream, operationg on decompressed raw data including all zero
+chunk data.
+
+Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
+---
+ pbs-restore.c | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/pbs-restore.c b/pbs-restore.c
+index 55a3cb235d..4efd18d19e 100644
+--- a/pbs-restore.c
++++ b/pbs-restore.c
+@@ -79,6 +79,8 @@ int main(int argc, char **argv)
+     const char *repository = NULL;
+     const char *backup_ns = NULL;
+     const char *keyfile = NULL;
++    const char *bw_limit = NULL;
++    const char *rate_limit = NULL;
+     int verbose = false;
+     bool skip_zero = false;
+     bool no_cache = false;
+@@ -95,6 +97,8 @@ int main(int argc, char **argv)
+             {"ns", required_argument, 0, 'n'},
+             {"keyfile", required_argument, 0, 'k'},
+             {"no-cache", no_argument, 0, 'N'},
++            {"bwlimit", required_argument, 0, 'l'},
++            {"rate-limit", required_argument, 0, 'L'},
+             {0, 0, 0, 0}
+         };
+         int c = getopt_long(argc, argv, "hvf:r:k:", long_options, NULL);
+@@ -129,6 +133,12 @@ int main(int argc, char **argv)
+             case 'N':
+                 no_cache = true;
+                 break;
++            case 'l':
++                bw_limit = g_strdup(argv[optind - 1]);
++                break;
++            case 'L':
++                rate_limit = g_strdup(argv[optind - 1]);
++                break;
+             case 'h':
+                 help();
+                 return 0;
+@@ -170,7 +180,7 @@ int main(int argc, char **argv)
+         fprintf(stderr, "connecting to repository '%s'\n", repository);
+     }
+     char *pbs_error = NULL;
+-    ProxmoxRestoreHandle *conn = proxmox_restore_new_ns(
++    ProxmoxRestoreHandle *conn = proxmox_restore_new_ns_rate_limited(
+         repository,
+         snapshot,
+         backup_ns,
+@@ -178,6 +188,8 @@ int main(int argc, char **argv)
+         keyfile,
+         key_password,
+         fingerprint,
++        bw_limit,
++        rate_limit,
+         &pbs_error
+     );
+     if (conn == NULL) {
+-- 
+2.47.3
+
diff --git a/debian/patches/series b/debian/patches/series
index 6ef37f4..947b48d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -77,3 +77,4 @@ pve/0044-PVE-backup-implement-backup-access-setup-and-teardow.patch
 pve/0045-PVE-backup-prepare-for-the-switch-to-using-blockdev-.patch
 pve/0046-savevm-async-reuse-migration-blocker-check-for-snaps.patch
 pve/0047-pbs-restore-add-no-cache-flag-to-skip-host-page-cach.patch
+pve/0048-pbs-restore-expose-optional-parameters-imposing-band.patch
-- 
2.47.3





  parent reply	other threads:[~2026-08-25  9:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-25  9:17 [PATCH many 0/8] fix #7530: Implement download bandwidth and restore limits for pbs-restore Christian Ebner
2026-08-25  9:17 ` [PATCH proxmox 1/8] pbs-api-types: expose ClientRateLimitConfig fields as pub Christian Ebner
2026-08-25  9:17 ` [PATCH proxmox-backup-qemu 2/8] restore: fix useless borrow clippy warnings for archive names Christian Ebner
2026-08-25  9:17 ` [PATCH proxmox-backup-qemu 3/8] commands: fix clippy error for reimplementing Result::ok() Christian Ebner
2026-08-25  9:17 ` [PATCH proxmox-backup-qemu 4/8] submodules: bump proxmox-backup submodule to 4.2.5 and fix api changes Christian Ebner
2026-08-25  9:17 ` [PATCH proxmox-backup-qemu 5/8] restore: implement `bw-limit` parameter imposing download rate limits Christian Ebner
2026-08-25  9:17 ` [PATCH proxmox-backup-qemu 6/8] restore: implement `rate-limit` imposing chunk data stream limits Christian Ebner
2026-08-25  9:17 ` Christian Ebner [this message]
2026-08-25  9:17 ` [PATCH qemu-server 8/8] pbs-restore: set restore bandwidth limit for volumes Christian Ebner

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=20260825091741.162883-8-c.ebner@proxmox.com \
    --to=c.ebner@proxmox.com \
    --cc=pbs-devel@lists.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