summaryrefslogtreecommitdiffstats
path: root/migration/ram.c
diff options
context:
space:
mode:
authorDavid Edmondson2021-12-21 10:34:41 +0100
committerJuan Quintela2022-01-28 15:38:23 +0100
commitae6806688016711bb9ec7541266d76ab511c5e3b (patch)
tree5464c40cf9a9d65e72120a71e13f42e37acc0b28 /migration/ram.c
parentmigration: Introduce ram_transferred_add() (diff)
downloadqemu-ae6806688016711bb9ec7541266d76ab511c5e3b.tar.gz
qemu-ae6806688016711bb9ec7541266d76ab511c5e3b.tar.xz
qemu-ae6806688016711bb9ec7541266d76ab511c5e3b.zip
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>
Diffstat (limited to 'migration/ram.c')
-rw-r--r--migration/ram.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/migration/ram.c b/migration/ram.c
index 619a1d9a6b..ca879c744f 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -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;
}