migrate: add transfer summary

Showing a final transfer log line helps with identifying what was
actually transferred. E.g., it could happen that the VFIO state was
only transferred in the last iteration. In such a case we would not
see that information at all.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
Tested-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Dominik Csapak 2025-03-11 14:20:49 +01:00 committed by Thomas Lamprecht
parent 09f8d3f19e
commit abdc7cdd89

View File

@ -1288,6 +1288,20 @@ sub phase2 {
my $downtime = $stat->{downtime} || 0;
$self->log('info', "average migration speed: $avg_speed/s - downtime $downtime ms");
}
my $trans = $memstat->{transferred} || 0;
my $vfio_transferred = $stat->{vfio}->{transferred} || 0;
if ($trans > 0 || $vfio_transferred > 0) {
my $transferred_h = render_bytes($trans, 1);
my $summary = "transferred $transferred_h VM-state";
if ($vfio_transferred > 0) {
my $vfio_h = render_bytes($vfio_transferred, 1);
$summary .= " (+ $vfio_h VFIO-state)";
}
$self->log('info', "migration $status, $summary");
}
}
if ($status eq 'failed' || $status eq 'cancelled') {