From: Alexandre Derumier via pve-devel <pve-devel@lists.proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
Subject: [pve-devel] [PATCH qemu-server 2/6] qmphelpers: add qmp_deviceadd && qmp_devicedel
Date: Fri, 27 Jun 2025 14:42:24 +0200 [thread overview]
Message-ID: <mailman.688.1751028151.395.pve-devel@lists.proxmox.com> (raw)
In-Reply-To: <20250627124228.1542397-1-alexandre.derumier@groupe-cyllene.com>
[-- Attachment #1: Type: message/rfc822, Size: 4052 bytes --]
From: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH qemu-server 2/6] qmphelpers: add qmp_deviceadd && qmp_devicedel
Date: Fri, 27 Jun 2025 14:42:24 +0200
Message-ID: <20250627124228.1542397-3-alexandre.derumier@groupe-cyllene.com>
old hmp methos can be removed when everything will be
converted to hash/json
Signed-off-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
---
src/PVE/QemuServer/QMPHelpers.pm | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/src/PVE/QemuServer/QMPHelpers.pm b/src/PVE/QemuServer/QMPHelpers.pm
index c3be2b8e..327ecec4 100644
--- a/src/PVE/QemuServer/QMPHelpers.pm
+++ b/src/PVE/QemuServer/QMPHelpers.pm
@@ -9,6 +9,8 @@ use PVE::QemuServer::Monitor qw(mon_cmd);
use base 'Exporter';
our @EXPORT_OK = qw(
+ qmp_deviceadd
+ qmp_devicedel
qemu_deviceadd
qemu_devicedel
qemu_objectadd
@@ -35,6 +37,20 @@ sub qemu_devicedel {
PVE::QemuServer::Monitor::hmp_cmd($vmid, "device_del $deviceid", 25);
}
+sub qmp_deviceadd {
+ my ($vmid, $opts) = @_;
+
+ $opts->{timeout} = 25;
+ mon_cmd($vmid, "device_add", %$opts);
+}
+
+sub qmp_devicedel {
+ my ($vmid, $deviceid) = @_;
+
+ my $opts = { id => $deviceid, timeout => 25 };
+ mon_cmd($vmid, "device_del", %$opts);
+}
+
sub qemu_objectadd {
my ($vmid, $objectid, $qomtype) = @_;
--
2.39.5
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-06-27 12:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250627124228.1542397-1-alexandre.derumier@groupe-cyllene.com>
2025-06-27 12:42 ` [pve-devel] [PATCH qemu-server 1/6] pci: add get_pci_addr Alexandre Derumier via pve-devel
2025-06-27 12:42 ` Alexandre Derumier via pve-devel [this message]
2025-06-27 12:42 ` [pve-devel] [PATCH qemu-server 3/6] convert drive device to json format Alexandre Derumier via pve-devel
2025-06-27 12:42 ` [pve-devel] [PATCH qemu-server 4/6] convert iothread to json Alexandre Derumier via pve-devel
2025-06-27 12:42 ` [pve-devel] [PATCH qemu-server 5/6] convert disk controller device to json format Alexandre Derumier via pve-devel
2025-06-27 12:42 ` [pve-devel] [PATCH qemu-server 6/6] tests: cfg2cmd: convert drive devices " Alexandre Derumier via pve-devel
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=mailman.688.1751028151.395.pve-devel@lists.proxmox.com \
--to=pve-devel@lists.proxmox.com \
--cc=alexandre.derumier@groupe-cyllene.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