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 112BF1FF0AA for ; Tue, 17 Nov 2026 17:39:49 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 1CD5E21674; Tue, 17 Nov 2026 17:39:48 +0100 (CET) Message-ID: <21f3d4c9-bd26-4b9b-b69d-ff4d52dba947@proxmox.com> Date: Tue, 17 Nov 2026 17:39:37 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH qemu-server v4 3/4] helpers: return integer values for parse_number_sets To: Elias Huhsovitz , pve-devel@lists.proxmox.com References: <20261111152027.260117-1-e.huhsovitz@proxmox.com> <20261111152027.260117-4-e.huhsovitz@proxmox.com> Content-Language: en-US From: Dominik Csapak In-Reply-To: <20261111152027.260117-4-e.huhsovitz@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794933577860 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.286 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: FFE2V5EVDHRIDDQD6G5DCT56P2T2QJRT X-Message-ID-Hash: FFE2V5EVDHRIDDQD6G5DCT56P2T2QJRT X-MailFrom: d.csapak@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 VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Reviewed-by: Dominik Csapak On 11/11/26 4:21 PM, Elias Huhsovitz wrote: > 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 > --- > 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 ecd1944f..ed1b9799 100644 > --- a/src/PVE/QemuServer/Helpers.pm > +++ b/src/PVE/QemuServer/Helpers.pm > @@ -308,7 +308,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"; > }