all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server 1/5] move parse_number_sets() helper to helpers module
Date: Mon,  4 Sep 2023 13:39:45 +0200	[thread overview]
Message-ID: <20230904113949.940431-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20230904113949.940431-1-f.ebner@proxmox.com>

In preparation to move parse_numa() to the memory module.

No functional change intended.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 PVE/QemuServer.pm         | 16 +---------------
 PVE/QemuServer/Helpers.pm | 15 +++++++++++++++
 2 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index bf1de179..ed604a80 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -49,7 +49,7 @@ use PVE::Tools qw(run_command file_read_firstline file_get_contents dir_glob_for
 
 use PVE::QMPClient;
 use PVE::QemuConfig;
-use PVE::QemuServer::Helpers qw(min_version config_aware_timeout windows_version);
+use PVE::QemuServer::Helpers qw(config_aware_timeout min_version parse_number_sets windows_version);
 use PVE::QemuServer::Cloudinit;
 use PVE::QemuServer::CGroup;
 use PVE::QemuServer::CPUConfig qw(print_cpu_device get_cpu_options);
@@ -1930,20 +1930,6 @@ sub print_vga_device {
     return "$type,id=${vgaid}${memory}${max_outputs}${pciaddr}${edidoff}";
 }
 
-sub parse_number_sets {
-    my ($set) = @_;
-    my $res = [];
-    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 ];
-	} else {
-	    die "invalid range: $part\n";
-	}
-    }
-    return $res;
-}
-
 sub parse_numa {
     my ($data) = @_;
 
diff --git a/PVE/QemuServer/Helpers.pm b/PVE/QemuServer/Helpers.pm
index ee3979df..99eb33a0 100644
--- a/PVE/QemuServer/Helpers.pm
+++ b/PVE/QemuServer/Helpers.pm
@@ -13,6 +13,7 @@ use base 'Exporter';
 our @EXPORT_OK = qw(
 min_version
 config_aware_timeout
+parse_number_sets
 windows_version
 );
 
@@ -186,6 +187,20 @@ sub pvecfg_min_version {
     die "internal error: cannot check version of invalid string '$verstr'";
 }
 
+sub parse_number_sets {
+    my ($set) = @_;
+    my $res = [];
+    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 ];
+	} else {
+	    die "invalid range: $part\n";
+	}
+    }
+    return $res;
+}
+
 sub windows_version {
     my ($ostype) = @_;
 
-- 
2.39.2





  reply	other threads:[~2023-09-04 11:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-04 11:39 [pve-devel] [PATCH-SERIES qemu-server] avoid cyclic use of main module in memory module Fiona Ebner
2023-09-04 11:39 ` Fiona Ebner [this message]
2023-09-04 11:39 ` [pve-devel] [PATCH qemu-server 2/5] move NUMA-related code into " Fiona Ebner
2023-09-04 11:39 ` [pve-devel] [PATCH qemu-server 3/5] memory: replace deprecated check_running() call Fiona Ebner
2023-09-04 11:39 ` [pve-devel] [PATCH qemu-server 4/5] introduce QMPHelpers module Fiona Ebner
2023-09-04 11:39 ` [pve-devel] [PATCH qemu-server 5/5] add memory parser Fiona Ebner
2023-09-18 15:12 ` [pve-devel] applied-series: [PATCH-SERIES qemu-server] avoid cyclic use of main module in memory module Thomas Lamprecht

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=20230904113949.940431-2-f.ebner@proxmox.com \
    --to=f.ebner@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal