[pve-devel] [PATCH qemu-server 5/5] vzdump: log 'finishing' state

Stefan Reiter s.reiter at proxmox.com
Mon Sep 28 17:48:36 CEST 2020


...and avoid printing 100% status twice

Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
---
 PVE/VZDump/QemuServer.pm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/PVE/VZDump/QemuServer.pm b/PVE/VZDump/QemuServer.pm
index 7297795..575abb3 100644
--- a/PVE/VZDump/QemuServer.pm
+++ b/PVE/VZDump/QemuServer.pm
@@ -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;
-- 
2.20.1






More information about the pve-devel mailing list