]> git.proxmox.com Git - qemu-server.git/commitdiff
vzdump: log 100% percent in case $target is 0
authorStefan Reiter <s.reiter@proxmox.com>
Wed, 19 Aug 2020 15:02:03 +0000 (17:02 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 19 Aug 2020 16:20:34 +0000 (18:20 +0200)
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@proxmox.com>
PVE/VZDump/QemuServer.pm

index 5edc62ba29735659353931241a97d2ff1ca93154..c919aa9c92c4c190e1a91abae8e15ec5a7ed7c15 100644 (file)
@@ -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);