migration: Tally pre-copy, downtime and post-copy bytes independently

Provide information on the number of bytes copied in the pre-copy,
downtime and post-copy phases of migration.

Signed-off-by: David Edmondson <david.edmondson@oracle.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
David Edmondson 2021-12-21 09:34:41 +00:00 committed by Juan Quintela
parent 4c2d0f6dca
commit ae68066880
4 changed files with 34 additions and 1 deletions

View file

@ -389,6 +389,13 @@ MigrationStats ram_counters;
static void ram_transferred_add(uint64_t bytes)
{
if (runstate_is_running()) {
ram_counters.precopy_bytes += bytes;
} else if (migration_in_postcopy()) {
ram_counters.postcopy_bytes += bytes;
} else {
ram_counters.downtime_bytes += bytes;
}
ram_counters.transferred += bytes;
}