From 4ee69c54f6d8e75b38eeb8fdfa0431f864c226e8 Mon Sep 17 00:00:00 2001 From: Fiona Ebner Date: Fri, 3 May 2024 13:19:50 +0200 Subject: [PATCH] monitor: allow passing timeout for a HMP command 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 --- 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);