* [PATCH-SERIES qemu-server 0/2] use v5.36 for qmp helpers module
@ 2026-05-27 7:44 Fiona Ebner
2026-05-27 7:44 ` [PATCH qemu-server 1/2] tests: cfg2cmd: also use minor version when comparing versions Fiona Ebner
2026-05-27 7:44 ` [PATCH qemu-server 2/2] qmp helpers: use v5.36 and signatures Fiona Ebner
0 siblings, 2 replies; 3+ messages in thread
From: Fiona Ebner @ 2026-05-27 7:44 UTC (permalink / raw)
To: pve-devel
Fell out of some other work on the side, but I chose a different
approach there in the end, so sending it as its own small series.
qemu-server:
Fiona Ebner (2):
tests: cfg2cmd: also use minor version when comparing versions
qmp helpers: use v5.36 and signatures
src/PVE/QemuServer/QMPHelpers.pm | 27 +++++++--------------------
src/test/run_config2command_tests.pl | 7 ++++---
2 files changed, 11 insertions(+), 23 deletions(-)
Summary over all repositories:
2 files changed, 11 insertions(+), 23 deletions(-)
--
Generated by git-murpp 0.5.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH qemu-server 1/2] tests: cfg2cmd: also use minor version when comparing versions
2026-05-27 7:44 [PATCH-SERIES qemu-server 0/2] use v5.36 for qmp helpers module Fiona Ebner
@ 2026-05-27 7:44 ` Fiona Ebner
2026-05-27 7:44 ` [PATCH qemu-server 2/2] qmp helpers: use v5.36 and signatures Fiona Ebner
1 sibling, 0 replies; 3+ messages in thread
From: Fiona Ebner @ 2026-05-27 7:44 UTC (permalink / raw)
To: pve-devel
In practice, non-test callers will always pass the minor version too,
so do the same in the test. The tests do already specify a minor
version, it just was not passed to the check.
In preparation for making the minor version a required parameter for
runs_at_least_qemu_version() when switching to signatures with v5.36.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/test/run_config2command_tests.pl | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/test/run_config2command_tests.pl b/src/test/run_config2command_tests.pl
index 0341d2f9..5c3034ab 100755
--- a/src/test/run_config2command_tests.pl
+++ b/src/test/run_config2command_tests.pl
@@ -671,9 +671,10 @@ sub do_test($config_fn) {
}
# check if QEMU version set correctly and test version_cmp
- (my $qemu_major = get_test_qemu_version()) =~ s/\..*$//;
- die "runs_at_least_qemu_version returned false, maybe error in version_cmp?"
- if !PVE::QemuServer::QMPHelpers::runs_at_least_qemu_version($vmid, $qemu_major);
+ (my $qemu_major, my $qemu_minor) = get_test_qemu_version() =~ m/^(\d+)\.(\d+)/;
+ if (!PVE::QemuServer::QMPHelpers::runs_at_least_qemu_version($vmid, $qemu_major, $qemu_minor)) {
+ die "runs_at_least_qemu_version returned false, maybe error in version_cmp?";
+ }
$cmdline =~ s/ -/ \\\n -/g; # same as qm showcmd --pretty
$cmdline .= "\n";
--
2.47.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH qemu-server 2/2] qmp helpers: use v5.36 and signatures
2026-05-27 7:44 [PATCH-SERIES qemu-server 0/2] use v5.36 for qmp helpers module Fiona Ebner
2026-05-27 7:44 ` [PATCH qemu-server 1/2] tests: cfg2cmd: also use minor version when comparing versions Fiona Ebner
@ 2026-05-27 7:44 ` Fiona Ebner
1 sibling, 0 replies; 3+ messages in thread
From: Fiona Ebner @ 2026-05-27 7:44 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/QemuServer/QMPHelpers.pm | 27 +++++++--------------------
1 file changed, 7 insertions(+), 20 deletions(-)
diff --git a/src/PVE/QemuServer/QMPHelpers.pm b/src/PVE/QemuServer/QMPHelpers.pm
index 9e0996cc..b4c6d1e7 100644
--- a/src/PVE/QemuServer/QMPHelpers.pm
+++ b/src/PVE/QemuServer/QMPHelpers.pm
@@ -1,7 +1,6 @@
package PVE::QemuServer::QMPHelpers;
-use warnings;
-use strict;
+use v5.36;
use PVE::QemuServer::Helpers;
use PVE::QemuServer::Monitor qw(mon_cmd);
@@ -15,37 +14,27 @@ our @EXPORT_OK = qw(
qemu_objectdel
);
-sub nbd_stop {
- my ($vmid) = @_;
-
+sub nbd_stop($vmid) {
mon_cmd($vmid, 'nbd-server-stop', timeout => 25);
}
-sub qemu_deviceadd {
- my ($vmid, $devicefull) = @_;
-
+sub qemu_deviceadd($vmid, $devicefull) {
$devicefull = "driver=" . $devicefull;
PVE::QemuServer::Monitor::hmp_cmd($vmid, "device_add $devicefull", 25);
}
-sub qemu_devicedel {
- my ($vmid, $deviceid) = @_;
-
+sub qemu_devicedel($vmid, $deviceid) {
PVE::QemuServer::Monitor::hmp_cmd($vmid, "device_del $deviceid", 25);
}
-sub qemu_objectadd {
- my ($vmid, $objectid, $qomtype, %args) = @_;
-
+sub qemu_objectadd($vmid, $objectid, $qomtype, %args) {
mon_cmd($vmid, "object-add", id => $objectid, "qom-type" => $qomtype, %args);
return 1;
}
-sub qemu_objectdel {
- my ($vmid, $objectid) = @_;
-
+sub qemu_objectdel($vmid, $objectid) {
mon_cmd($vmid, "object-del", id => $objectid);
return 1;
@@ -53,9 +42,7 @@ sub qemu_objectdel {
# dies if a) VM not running or not existing b) Version query failed
# So, any defined return value is valid, any invalid state can be caught by eval
-sub runs_at_least_qemu_version {
- my ($vmid, $major, $minor, $extra) = @_;
-
+sub runs_at_least_qemu_version($vmid, $major, $minor, $extra = undef) {
my $v = PVE::QemuServer::Monitor::mon_cmd($vmid, 'query-version');
die "could not query currently running version for VM $vmid\n" if !defined($v);
$v = $v->{qemu};
--
2.47.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-27 7:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-27 7:44 [PATCH-SERIES qemu-server 0/2] use v5.36 for qmp helpers module Fiona Ebner
2026-05-27 7:44 ` [PATCH qemu-server 1/2] tests: cfg2cmd: also use minor version when comparing versions Fiona Ebner
2026-05-27 7:44 ` [PATCH qemu-server 2/2] qmp helpers: use v5.36 and signatures Fiona Ebner
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.