add nowarn to qga_check_running

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2018-05-30 08:20:25 +02:00
parent 87f5df81a7
commit a4938c7217
2 changed files with 3 additions and 3 deletions

View File

@ -174,7 +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);
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");

View File

@ -6095,11 +6095,11 @@ sub do_snapshots_with_qemu {
}
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;