[pve-devel] [PATCH qemu-server 4/9] Fix guest agent shutdown without timeout
Oguz Bektas
o.bektas at proxmox.com
Fri Nov 15 14:58:58 CET 2019
From: Stefan Reiter <s.reiter at proxmox.com>
Regression from change allowing timeouts to be set, now shutting down
also works without timeouts again (previously qmp failed because of
the unknown "timeout" parameter passed to it).
We always delete the timeout value from the arguments, regardless of
truthiness. "delete" returns the deleted element, deleting a
non-existant hash entry returns undef, which is fine after this point:
"deleting non-existent elements returns the undefined value in their
corresponding positions."
- https://perldoc.perl.org/functions/delete.html
Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
(cherry picked from commit 1688362d4e0367888c9d2f592e7948e5b4e8069a)
Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
---
PVE/QemuServer.pm | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 8581fed..8b255e8 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -5485,9 +5485,8 @@ sub vm_qmp_command {
my $res;
my $timeout;
- if ($cmd->{arguments} && $cmd->{arguments}->{timeout}) {
- $timeout = $cmd->{arguments}->{timeout};
- delete $cmd->{arguments}->{timeout};
+ if ($cmd->{arguments}) {
+ $timeout = delete $cmd->{arguments}->{timeout};
}
eval {
--
2.20.1
More information about the pve-devel
mailing list