]> git.proxmox.com Git - qemu-server.git/commitdiff
vzdump: log 'finishing' state
authorStefan Reiter <s.reiter@proxmox.com>
Mon, 28 Sep 2020 15:48:36 +0000 (17:48 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 29 Sep 2020 15:28:15 +0000 (17:28 +0200)
...and avoid printing 100% status twice

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
PVE/VZDump/QemuServer.pm

index 7297795b6cce61c44190c943c1bf7c098da0ab16..575abb3a8adea77251815f98ef564797a63e7725 100644 (file)
@@ -360,6 +360,7 @@ my $query_backup_status_loop = sub {
     }
 
     my $first_round = 1;
+    my $last_finishing = 0;
     while(1) {
        my $status = mon_cmd($vmid, 'query-backup');
 
@@ -401,7 +402,9 @@ my $query_backup_status_loop = sub {
 
        my $res = $status->{status} || 'unknown';
        if ($res ne 'active') {
-           $self->loginfo($statusline);
+           if ($last_percent < 100) {
+               $self->loginfo($statusline);
+           }
            if ($res ne 'done') {
                die (($status->{errmsg} || "unknown error") . "\n") if $res eq 'error';
                die "got unexpected status '$res'\n";
@@ -421,6 +424,11 @@ my $query_backup_status_loop = sub {
            $last_transferred = $transferred if $transferred;
            $last_time = $ctime;
            $last_reused = $reused;
+
+           if (!$last_finishing && $status->{finishing}) {
+               $self->loginfo("Waiting for server to finish verification...");
+           }
+           $last_finishing = $status->{finishing};
        }
        sleep(1);
        $first_round = 0 if $first_round;