mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-01 04:51:50 +00:00
add nowarn to qga_check_running
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
87f5df81a7
commit
a4938c7217
@ -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");
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user