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

Dominik Csapak d.csapak at proxmox.com
Wed Mar 11 10:52:50 CET 2020


tested and worked like before on windows(10)/linux(debian buster)
(saw no obvious breakage), are there any other
guest-agents that we could test?

also from looking through the code it seems harmless, so
altough we do not support macos directly,
i guess we can include this

(the qmp-spec does not mention any whitespace in/between
json objects,only other control characters are an error, so i'd assume 
its okay)

Tested-By: Dominik Csapak <d.csapak at proxmox.com>
Reviewed-By: Dominik Csapak <d.csapak at proxmox.com>

On 3/9/20 2:32 PM, Kamil Trzcinski wrote:
> 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 {
>   
> 





More information about the pve-devel mailing list