[pve-devel] [PATCH qemu-server 1/1] Harmonize log format with disk transfer, add percentage

helmo at initfour.nl helmo at initfour.nl
Wed Apr 22 22:04:13 CEST 2020


From: Herman van Rink <rink at initfour.nl>

Signed-off-by: Herman van Rink <rink at initfour.nl>
---
 PVE/QemuMigrate.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index d90b709..f163d0a 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -1013,8 +1013,9 @@ sub phase2 {
 		# reduce sleep if remainig memory is lower than the average transfer speed
 		$usleep = 100000 if $avglstat && $rem < $avglstat;
 
-		$self->log('info', "migration status: $stat->{status} (transferred ${trans}, " .
-			   "remaining ${rem}), total ${total})");
+		my $trans_percent = sprintf "%.2f", ($trans * 100 / $total);
+		$self->log('info', "migration status: $stat->{status} transferred: ${trans} bytes " .
+			   "remaining: ${rem} bytes total: ${total} bytes progression: ${trans_percent} %");
 
 		if (${xbzrlecachesize}) {
 		    $self->log('info', "migration xbzrle cachesize: ${xbzrlecachesize} transferred ${xbzrlebytes} pages ${xbzrlepages} cachemiss ${xbzrlecachemiss} overflow ${xbzrleoverflow}");
-- 
2.17.1




More information about the pve-devel mailing list