aboutsummaryrefslogtreecommitdiff
path: root/migration/migration.h
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2018-01-03 20:20:13 +0800
committerJuan Quintela <quintela@redhat.com>2018-01-15 12:48:10 +0100
commitb15df1ae5063c7c181f8f068f9eba7661b3b5e1c (patch)
treefb418779d4259636b041fa4acde9e8222a5671a0 /migration/migration.h
parent39b9e17905c5ff8302c0ff17af546cbf68e0b4f6 (diff)
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 <peterx@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration/migration.h')
-rw-r--r--migration/migration.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/migration/migration.h b/migration/migration.h
index 0aad12f9a1..f2bc1aaf85 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;