From 1928c2018826f30dc7d8166df8ba0f50402672a8 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Tue, 20 Feb 2018 09:43:44 +0100 Subject: [PATCH] return error from guest-agent in case of e.g. a non-existant guest-agent command, it would return { error: {someerrorobject} } but we did only include the 'return' property in case we do not get any and the error property is set, return that i looked at all the paths were we use the QMPClient, and either we have our own callback for the result, or we do not rely on the result being empty upon an error, so this should not break anything Signed-off-by: Dominik Csapak --- PVE/QMPClient.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/PVE/QMPClient.pm b/PVE/QMPClient.pm index 9e32533..2277fef 100755 --- a/PVE/QMPClient.pm +++ b/PVE/QMPClient.pm @@ -92,6 +92,7 @@ sub cmd { my $callback = sub { my ($vmid, $resp) = @_; $result = $resp->{'return'}; + $result = { error => $resp->{'error'} } if !defined($result) && $resp->{'error'}; }; die "no command specified" if !($cmd && $cmd->{execute}); -- 2.39.2