public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Elias Huhsovitz <e.huhsovitz@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Elias Huhsovitz <e.huhsovitz@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	[thread overview]
Message-ID: <20261124131858.135785-2-e.huhsovitz@proxmox.com> (raw)
In-Reply-To: <20261124131858.135785-1-e.huhsovitz@proxmox.com>

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 <e.huhsovitz@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
---
 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





  reply	other threads:[~2026-11-24 13:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 13:18 [PATCH common/qemu-server v5 0/4] vCPU binding for qemu guests Elias Huhsovitz
2026-11-24 13:18 ` Elias Huhsovitz [this message]
2026-11-24 13:18 ` [PATCH qemu-server v5 2/4] cpu: add cpu-binding Elias Huhsovitz
2026-11-24 13:18 ` [PATCH common v5 3/4] syscall: add sched_setaffinity Elias Huhsovitz
2026-11-24 13:18 ` [PATCH common v5 4/4] cpuset: generalize to improve usability for sysfs cpusets Elias Huhsovitz

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=20261124131858.135785-2-e.huhsovitz@proxmox.com \
    --to=e.huhsovitz@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