If we freeze the fs with the Qemu-Guest-Agent test if QGA is running.

This commit is contained in:
Wolfgang Link 2016-02-15 11:45:56 +01:00 committed by Dietmar Maurer
parent 3f74d8a1ab
commit 4dcc780c2a

View File

@ -6120,6 +6120,17 @@ sub do_snapshots_with_qemu {
return undef;
}
sub qga_check_running {
my ($vmid) = @_;
eval { vm_mon_cmd($vmid, "guest-ping", timeout => 3); };
if ($@) {
warn "Qemu Guest Agent are not running - $@";
return 0;
}
return 1;
}
sub snapshot_create {
my ($vmid, $snapname, $save_vmstate, $comment) = @_;
@ -6131,7 +6142,7 @@ sub snapshot_create {
my $running = check_running($vmid);
my $freezefs = $running && $config->{agent};
my $freezefs = $running && $config->{agent} && qga_check_running($vmid);
$freezefs = 0 if $snap->{vmstate}; # not needed if we save RAM
my $drivehash = {};