From b4be9c0207ae634ab82265d25e7ff59604a3b709 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 6 Jul 2020 21:47:30 +0200 Subject: [PATCH] backup: PBS: save backup task size normally this is done centrally in the managers code, but we do not have the info for PBS there. Signed-off-by: Thomas Lamprecht --- PVE/VZDump/QemuServer.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/PVE/VZDump/QemuServer.pm b/PVE/VZDump/QemuServer.pm index 77dc20e7..ff4a6a20 100644 --- a/PVE/VZDump/QemuServer.pm +++ b/PVE/VZDump/QemuServer.pm @@ -369,6 +369,11 @@ my $query_backup_status_loop = sub { my $zero_h = bytes_to_human($last_zero, 2); $self->loginfo("Backup is sparse: ${zero_per}% ($zero_h) zero data"); } + + return { + total => $last_total, + reused => $reused, + }; }; sub archive_pbs { @@ -393,6 +398,7 @@ sub archive_pbs { my $diskcount = scalar(@{$task->{disks}}); if (PVE::QemuConfig->is_template($self->{vmlist}->{$vmid}) || !$diskcount) { my @pathlist; + # FIXME: accumulate disk sizes to use for backup job (email) log foreach my $di (@{$task->{disks}}) { if ($di->{type} eq 'block' || $di->{type} eq 'file') { push @pathlist, "$di->{qmdevice}.img:$di->{path}"; @@ -471,7 +477,8 @@ sub archive_pbs { $self->resume_vm_after_job_start($task, $vmid); - $query_backup_status_loop->($self, $vmid, $backup_job_uuid); + my $res = $query_backup_status_loop->($self, $vmid, $backup_job_uuid); + $task->{size} = $res->{total}; }; my $err = $@; if ($err) {