[pve-devel] [PATCH v2 qemu-server 1/1] Append newline to all QGA commands

Kamil Trzcinski ayufan at ayufan.eu
Mon Mar 9 14:32:44 CET 2020


Since the MacOS Mojave Apple ships AppleQEMUGuestAgent
by default. However, it does not fully adhere to QGA
specs as they do expect each command to be newline
delimited.

This makes each command to be newline delimited
which is harmless for all other systems (Windows, Linux),
but enable guest agent by default without any changes
on OSX.

Signed-off-by: Kamil Trzcinski <ayufan at ayufan.eu>
---
 PVE/QMPClient.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/PVE/QMPClient.pm b/PVE/QMPClient.pm
index b5c6921..90cba64 100644
--- a/PVE/QMPClient.pm
+++ b/PVE/QMPClient.pm
@@ -263,8 +263,8 @@ my $check_queue = sub {
 	    if ($qga) {
 
 		$qmpcmd = to_json({ execute => 'guest-sync-delimited',
-				    arguments => { id => int($cmd->{id})}}) .
-		    to_json({ execute => $cmd->{execute}, arguments => $cmd->{arguments}});
+				    arguments => { id => int($cmd->{id})}}) . "\n" .
+		    to_json({ execute => $cmd->{execute}, arguments => $cmd->{arguments}}) . "\n";
 
 	    } else {
 
-- 
2.11.0




More information about the pve-devel mailing list