[pve-devel] [PATCH qemu-server] qm agent : check if qga service is running

Thomas Lamprecht t.lamprecht at proxmox.com
Wed May 30 07:49:00 CEST 2018


I'll agree with the patches intent, two notes inline

On 5/28/18 5:36 PM, Alexandre Derumier wrote:
> ---
>  PVE/API2/Qemu/Agent.pm | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/PVE/API2/Qemu/Agent.pm b/PVE/API2/Qemu/Agent.pm
> index 9af5d5f..fbc8105 100644
> --- a/PVE/API2/Qemu/Agent.pm
> +++ b/PVE/API2/Qemu/Agent.pm
> @@ -174,6 +174,7 @@ sub register_command {
>  
>  	    die "No Qemu Guest Agent\n" if !defined($conf->{agent});
>  	    die "VM $vmid is not running\n" if !PVE::QemuServer::check_running($vmid);
> +	    die "Qemu Guest Agent is not running\n" if !PVE::QemuServer::qga_check_running($vmid);

check running uses the ping command, so maybe we should exempt it here and always
to it - may not make sense to check with ping if we can do ping, or what do you mean?

Further, qga_check_running always does a: warn "Qemu Guest Agent is not running - $@";

So I actually get:

# pvesh create nodes/dev5/qemu/12312321/agent/fstrim
Qemu Guest Agent is not running - VM 12312321 qmp command 'guest-ping' failed - got timeout
Qemu Guest Agent is not running

We could add a $silent parameter to qga_check_running to avoid that.

>  
>  	    my $cmd = $param->{command} // $command;
>  	    my $res = PVE::QemuServer::vm_mon_cmd($vmid, "guest-$cmd");
> 





More information about the pve-devel mailing list