]> git.proxmox.com Git - qemu-server.git/commitdiff
add nowarn to qga_check_running
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 30 May 2018 06:20:25 +0000 (08:20 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 30 May 2018 07:01:11 +0000 (09:01 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/API2/Qemu/Agent.pm
PVE/QemuServer.pm

index fbc8105b94d80f92de239b4d64c3504eb2814428..5141b4e2a50312aa002f275b32bda58ad07bcf32 100644 (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");
index 9c4ac94c75a1e9a3164c2f0d47bca688fdb43a90..00e16694c67a1f837d5fb58e4e4e66d7cc47fed9 100644 (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;