[pve-devel] [PATCH qemu-server v6 10/10] migrate: add transfer summary

Dominik Csapak d.csapak at proxmox.com
Thu Feb 13 14:17:09 CET 2025


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 at proxmox.com>
---
new in v6
 PVE/QemuMigrate.pm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index d6f9132b..babd81a1 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -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') {
-- 
2.39.5





More information about the pve-devel mailing list