From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH qemu-server 2/2] qmp helpers: use v5.36 and signatures
Date: Wed, 27 May 2026 09:44:53 +0200 [thread overview]
Message-ID: <20260527074545.41948-3-f.ebner@proxmox.com> (raw)
In-Reply-To: <20260527074545.41948-1-f.ebner@proxmox.com>
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
prev parent reply other threads:[~2026-05-27 7:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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=20260527074545.41948-3-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.