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 <f.ebner@proxmox.com>
This commit is contained in:
Fiona Ebner 2024-05-03 13:19:50 +02:00 committed by Fabian Grünbichler
parent 46e0b1eb62
commit 4ee69c54f6

View File

@ -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);