diff --git a/PVE/API2/Qemu/Agent.pm b/PVE/API2/Qemu/Agent.pm index fbc8105b..5141b4e2 100644 --- a/PVE/API2/Qemu/Agent.pm +++ b/PVE/API2/Qemu/Agent.pm @@ -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"); diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 9c4ac94c..00e16694 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -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;