--- Begin Message ---
old hmp methos can be removed when everything will be
converted to hash/json

Signed-off-by: Alexandre Derumier <alexandre.derum...@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



--- End Message ---
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to