Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
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);
+ die "Qemu Guest Agent is not running\n" if !PVE::QemuServer::qga_check_running($vmid, 1);
my $cmd = $param->{command} // $command;
my $res = PVE::QemuServer::vm_mon_cmd($vmid, "guest-$cmd");
}
sub qga_check_running {
- my ($vmid) = @_;
+ my ($vmid, $nowarn) = @_;
eval { vm_mon_cmd($vmid, "guest-ping", timeout => 3); };
if ($@) {
- warn "Qemu Guest Agent is not running - $@";
+ warn "Qemu Guest Agent is not running - $@" if !$nowarn;
return 0;
}
return 1;