mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-07-09 12:17:16 +00:00
check if ga runs before a fsfreeze-freeze/thaw
since the guest-fsfreeze-freeze command has a timeout of 1 hour, we want to check if the guest-agent even runs before executing that, or else we wait 1 hour and then continue Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
44c2a647ff
commit
1a988fd2e8
@ -6079,7 +6079,8 @@ sub qemu_drive_mirror_monitor {
|
||||
last if $skipcomplete; #do the complete later
|
||||
|
||||
if ($vmiddst && $vmiddst != $vmid) {
|
||||
if ($qga) {
|
||||
my $agent_running = $qga && qga_check_running($vmid);
|
||||
if ($agent_running) {
|
||||
print "freeze filesystem\n";
|
||||
eval { PVE::QemuServer::vm_mon_cmd($vmid, "guest-fsfreeze-freeze"); };
|
||||
} else {
|
||||
@ -6090,7 +6091,7 @@ sub qemu_drive_mirror_monitor {
|
||||
# if we clone a disk for a new target vm, we don't switch the disk
|
||||
PVE::QemuServer::qemu_blockjobs_cancel($vmid, $jobs);
|
||||
|
||||
if ($qga) {
|
||||
if ($agent_running) {
|
||||
print "unfreeze filesystem\n";
|
||||
eval { PVE::QemuServer::vm_mon_cmd($vmid, "guest-fsfreeze-thaw"); };
|
||||
} else {
|
||||
|
@ -404,7 +404,13 @@ sub archive {
|
||||
$qmpclient->queue_cmd($vmid, $add_fd_cb, 'getfd',
|
||||
fd => $outfileno, fdname => "backup");
|
||||
|
||||
if ($self->{vmlist}->{$vmid}->{agent} && $vm_is_running){
|
||||
my $agent_running = 0;
|
||||
|
||||
if ($self->{vmlist}->{$vmid}->{agent} && $vm_is_running) {
|
||||
$agent_running = PVE::QemuServer::qga_check_running($vmid);
|
||||
}
|
||||
|
||||
if ($agent_running){
|
||||
eval { PVE::QemuServer::vm_mon_cmd($vmid, "guest-fsfreeze-freeze"); };
|
||||
if (my $err = $@) {
|
||||
$self->logerr($err);
|
||||
@ -413,7 +419,7 @@ sub archive {
|
||||
|
||||
$qmpclient->queue_execute();
|
||||
|
||||
if ($self->{vmlist}->{$vmid}->{agent} && $vm_is_running ){
|
||||
if ($agent_running){
|
||||
eval { PVE::QemuServer::vm_mon_cmd($vmid, "guest-fsfreeze-thaw"); };
|
||||
if (my $err = $@) {
|
||||
$self->logerr($err);
|
||||
|
Loading…
Reference in New Issue
Block a user