[pve-devel] [PATCH v2 qemu-server 4/5] vzdump: log 100% percent in case $target is 0

Stefan Reiter s.reiter at proxmox.com
Wed Aug 19 17:02:03 CEST 2020


When $target is 0, that means we don't have to upload any data, in which
case we're immediately done.

Otherwise incremental backups with no changes display a really weird
  status: 0% (0.0 B of 0.0 B), duration 0, read: 0 B/s, write: 0 B/s
when they're actually done already.

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

diff --git a/PVE/VZDump/QemuServer.pm b/PVE/VZDump/QemuServer.pm
index 5edc62b..c919aa9 100644
--- a/PVE/VZDump/QemuServer.pm
+++ b/PVE/VZDump/QemuServer.pm
@@ -340,7 +340,7 @@ my $query_backup_status_loop = sub {
 	$target = $total if !$has_query_bitmap;
 	$transferred = $status->{transferred} || 0;
 	$reused = $status->{reused};
-	my $percent = $target ? int(($transferred * 100)/$target) : 0;
+	my $percent = $target ? int(($transferred * 100)/$target) : 100;
 	my $zero = $status->{'zero-bytes'} || 0;
 
 	die "got unexpected uuid\n" if !$status->{uuid} || ($status->{uuid} ne $job_uuid);
-- 
2.20.1






More information about the pve-devel mailing list