From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 015001FF0B7 for ; Tue, 25 Aug 2026 11:19:47 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id B43EB21860; Tue, 25 Aug 2026 11:18:15 +0200 (CEST) From: Christian Ebner 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 Message-ID: <20260825091741.162883-8-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260825091741.162883-1-c.ebner@proxmox.com> References: <20260825091741.162883-1-c.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1787649452752 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.710 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: N45RLOWMGAEMWKBMMNYM4DS3A2BULZNF X-Message-ID-Hash: N45RLOWMGAEMWKBMMNYM4DS3A2BULZNF X-MailFrom: c.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- ...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 +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 +--- + 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