From b15df1ae5063c7c181f8f068f9eba7661b3b5e1c Mon Sep 17 00:00:00 2001 From: Peter Xu Date: Wed, 3 Jan 2018 20:20:13 +0800 Subject: migration: cleanup stats update into function We have quite a few lines in migration_thread() that calculates some statistics for the migration interations. Isolate it into a single function to improve readability. Signed-off-by: Peter Xu Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/migration.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'migration/migration.h') diff --git a/migration/migration.h b/migration/migration.h index 0aad12f..f2bc1aa 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -102,6 +102,17 @@ struct MigrationState QEMUBH *cleanup_bh; QEMUFile *to_dst_file; + /* bytes already send at the beggining of current interation */ + uint64_t iteration_initial_bytes; + /* time at the start of current iteration */ + int64_t iteration_start_time; + /* + * The final stage happens when the remaining data is smaller than + * this threshold; it's calculated from the requested downtime and + * measured bandwidth + */ + int64_t threshold_size; + /* params from 'migrate-set-parameters' */ MigrationParameters parameters; -- cgit v1.1