[pve-devel] [PATCH qemu-server 1/5] monitor: allow passing timeout for a HMP command

Fiona Ebner f.ebner at proxmox.com
Fri May 3 13:19:50 CEST 2024


Passing the timeout key with an explicit value of undef is fine,
because both the absence of the timeout key and an explicit value of
undef will lead to $timeout being undef in the qmp_cmd() function.

In preparation to increase the timeout for certain (e.g. disk-related)
HMP commands.

Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 PVE/QemuServer/Monitor.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/PVE/QemuServer/Monitor.pm b/PVE/QemuServer/Monitor.pm
index a7567518..937006ae 100644
--- a/PVE/QemuServer/Monitor.pm
+++ b/PVE/QemuServer/Monitor.pm
@@ -50,11 +50,11 @@ sub mon_cmd {
 }
 
 sub hmp_cmd {
-    my ($vmid, $cmdline) = @_;
+    my ($vmid, $cmdline, $timeout) = @_;
 
     my $cmd = {
 	execute => 'human-monitor-command',
-	arguments => { 'command-line' => $cmdline },
+	arguments => { 'command-line' => $cmdline, timeout => $timeout },
     };
 
     return qmp_cmd($vmid, $cmd);
-- 
2.39.2





More information about the pve-devel mailing list