From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 39BD91FF066 for ; Tue, 24 Nov 2026 14:19:33 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 2D7B3216B6; Tue, 24 Nov 2026 14:19:16 +0100 (CET) From: Elias Huhsovitz To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server v5 1/4] helpers: return integer values for parse_number_sets Date: Tue, 24 Nov 2026 14:18:55 +0100 Message-ID: <20261124131858.135785-2-e.huhsovitz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261124131858.135785-1-e.huhsovitz@proxmox.com> References: <20261124131858.135785-1-e.huhsovitz@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795526351088 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.401 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: X27STJHKBQ7RK7I7GFMN4CFL5ZU4IZD2 X-Message-ID-Hash: X27STJHKBQ7RK7I7GFMN4CFL5ZU4IZD2 X-MailFrom: e.huhsovitz@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 CC: Elias Huhsovitz X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Currently the ranges returned by parse_number_sets are stored as strings. Historically this has not been a problem, since the ranges havent been used for calculation. New callers of this function might expect an integer value, instead of string. Convert the returned value to an integer. Signed-off-by: Elias Huhsovitz Reviewed-by: Dominik Csapak --- src/PVE/QemuServer/Helpers.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/PVE/QemuServer/Helpers.pm b/src/PVE/QemuServer/Helpers.pm index 644287bc..cc68f0fd 100644 --- a/src/PVE/QemuServer/Helpers.pm +++ b/src/PVE/QemuServer/Helpers.pm @@ -301,7 +301,11 @@ sub parse_number_sets { foreach my $part (split(/;/, $set)) { if ($part =~ /^\s*(\d+)(?:-(\d+))?\s*$/) { die "invalid range: $part ($2 < $1)\n" if defined($2) && $2 < $1; - push @$res, [$1, $2]; + + my $start = int($1); + my $end = defined($2) ? int($2) : undef; + + push @$res, [$start, $end]; } else { die "invalid range: $part\n"; } -- 2.47.3