[pve-devel] applied: [PATCH qemu-server] fix #2612: allow input-data in guest exec and make command optional

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Mar 6 17:58:35 CET 2020


On 2/27/20 11:47 AM, Stefan Reiter wrote:
> 'input-data' can be used to pass arbitrary data to a guest when running
> an agent command with 'guest-exec'. Most guest-agent implementations
> treat this as STDIN to the command given by "path"/"arg", but some go as
> far as relying solely on this parameter, and even fail if "path" or
> "arg" are set (e.g. Mikrotik Cloud Hosted Router) - thus "command" needs
> to be made optional.
> 
> Via the API, an arbitrary string can be passed, on the command line ('qm
> guest exec'), an additional '--pass-stdin' flag allows to forward STDIN
> of the qm process to 'input-data', with a size limitation of 1 MiB to
> not overwhelm QMP.
> 
> Without 'input-data' (API) or '--pass-stdin' (CLI) behaviour is unchanged.
> 
> Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
> ---
> 
> Tested with:
> 
> Debian-VM:
>     qm guest exec 101 --pass-stdin -- "file" "-" < PVE/QemuServer.pm
>     "out-data": "/dev/stdin: Perl5 module source, ASCII text\n"
> 
> Mikrotik CHR (ver. 6.46.3):
>     echo -n ":ip address print;" | qm guest exec 199 --pass-stdin
>     "out-data" : "Flags: X - disabled, I - invalid, D - dynamic ..." [snipped]
> 
> ...and running the same and a few more commands via the API/pvesh.
> 
> 

applied with followup noting the 1MiB limit in CLI and the 64KiB limit (http-server
POST limit) in API explicit.

Thanks!





More information about the pve-devel mailing list