* [PATCH qemu-server] tree-wide: properly adapt all version_cmp() calls to moved helper
@ 2026-11-03 9:48 Fiona Ebner
2026-11-03 12:32 ` applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Fiona Ebner @ 2026-11-03 9:48 UTC (permalink / raw)
To: pve-devel
While commit 47c17885 ("helpers: drop local version helpers in favor
of pve-common") works, because it explicitly imports version_cmp into
the QemuServer::Helpers module, its intention is to switch over the
helpers. Avoid the indirection as well as the duplicate PVE::Tools
include in the QemuServer::Helpers module.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/QemuServer/Drive.pm | 3 +--
src/PVE/QemuServer/Helpers.pm | 1 -
src/PVE/QemuServer/Machine.pm | 13 +++++--------
src/PVE/QemuServer/QMPHelpers.pm | 4 +++-
4 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/src/PVE/QemuServer/Drive.pm b/src/PVE/QemuServer/Drive.pm
index 0ca3d636..8b980650 100644
--- a/src/PVE/QemuServer/Drive.pm
+++ b/src/PVE/QemuServer/Drive.pm
@@ -845,8 +845,7 @@ sub virtio_win_iso_issue {
my $cmp_with = sub {
my ($other) = @_;
- return PVE::QemuServer::Helpers::version_cmp(map { ($version[$_], $other->[$_]) }
- 0 .. 2);
+ return PVE::Tools::version_cmp(map { ($version[$_], $other->[$_]) } 0 .. 2);
};
for my $issue ($virtio_win_issues->@*) {
diff --git a/src/PVE/QemuServer/Helpers.pm b/src/PVE/QemuServer/Helpers.pm
index cead2011..ecd1944f 100644
--- a/src/PVE/QemuServer/Helpers.pm
+++ b/src/PVE/QemuServer/Helpers.pm
@@ -11,7 +11,6 @@ use PVE::Cluster;
use PVE::INotify;
use PVE::ProcFSTools;
use PVE::Tools;
-use PVE::Tools qw(version_cmp);
use base 'Exporter';
our @EXPORT_OK = qw(
diff --git a/src/PVE/QemuServer/Machine.pm b/src/PVE/QemuServer/Machine.pm
index 79ecbec3..fa47d668 100644
--- a/src/PVE/QemuServer/Machine.pm
+++ b/src/PVE/QemuServer/Machine.pm
@@ -3,6 +3,8 @@ package PVE::QemuServer::Machine;
use strict;
use warnings;
+use PVE::Tools;
+
use PVE::QemuServer::Helpers;
use PVE::QemuServer::MetaInfo;
use PVE::QemuServer::Monitor;
@@ -298,13 +300,8 @@ sub machine_version_cmp {
my ($major_a, $minor_a, $pve_a) = extract_version_parts($machine_type_a);
my ($major_b, $minor_b, $pve_b) = extract_version_parts($machine_type_b);
- return PVE::QemuServer::Helpers::version_cmp(
- $major_a,
- $major_b,
- $minor_a,
- $minor_b,
- $pve_a,
- $pve_b,
+ return PVE::Tools::version_cmp(
+ $major_a, $major_b, $minor_a, $minor_b, $pve_a, $pve_b,
);
}
@@ -345,7 +342,7 @@ sub can_run_pve_machine_version {
my $pvever = $3;
$kvmversion =~ m/(\d+)\.(\d+)/;
- return 0 if PVE::QemuServer::Helpers::version_cmp($1, $major, $2, $minor) < 0;
+ return 0 if PVE::Tools::version_cmp($1, $major, $2, $minor) < 0;
# if $pvever is missing or 0, we definitely support it as long as we didn't
# fail the QEMU version check above
diff --git a/src/PVE/QemuServer/QMPHelpers.pm b/src/PVE/QemuServer/QMPHelpers.pm
index f474c123..6d9b0063 100644
--- a/src/PVE/QemuServer/QMPHelpers.pm
+++ b/src/PVE/QemuServer/QMPHelpers.pm
@@ -2,6 +2,8 @@ package PVE::QemuServer::QMPHelpers;
use v5.36;
+use PVE::Tools;
+
use PVE::QemuServer::Helpers;
use PVE::QemuServer::Monitor qw(mon_cmd);
@@ -59,7 +61,7 @@ sub runs_at_least_qemu_version($vmid, $major, $minor, $extra = undef) {
die "could not query currently running version for VM $vmid\n" if !defined($v);
$v = $v->{qemu};
- return PVE::QemuServer::Helpers::version_cmp(
+ return PVE::Tools::version_cmp(
$v->{major}, $major, $v->{minor}, $minor, $v->{micro}, $extra,
) >= 0;
}
--
2.47.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* applied: [PATCH qemu-server] tree-wide: properly adapt all version_cmp() calls to moved helper
2026-11-03 9:48 [PATCH qemu-server] tree-wide: properly adapt all version_cmp() calls to moved helper Fiona Ebner
@ 2026-11-03 12:32 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2026-11-03 12:32 UTC (permalink / raw)
To: pve-devel, Fiona Ebner
On Tue, 03 Nov 2026 10:48:41 +0100, Fiona Ebner wrote:
> While commit 47c17885 ("helpers: drop local version helpers in favor
> of pve-common") works, because it explicitly imports version_cmp into
> the QemuServer::Helpers module, its intention is to switch over the
> helpers. Avoid the indirection as well as the duplicate PVE::Tools
> include in the QemuServer::Helpers module.
>
>
> [...]
Applied, thanks!
[1/1] tree-wide: properly adapt all version_cmp() calls to moved helper
https://git.proxmox.com/?p=qemu-server.git;a=commitdiff;h=42176bad567e46d9c216d4df67207cd8ceb39176
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-03 12:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-03 9:48 [PATCH qemu-server] tree-wide: properly adapt all version_cmp() calls to moved helper Fiona Ebner
2026-11-03 12:32 ` applied: " Thomas Lamprecht
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.