Commit 0781c1ed authored by Wei Wang's avatar Wei Wang Committed by Dr. David Alan Gilbert
Browse files

migration: use s->threshold_size inside migration_update_counters



Fixes: b15df1ae ("migration: cleanup stats update into function")
The threshold size is changed to be recorded in s->threshold_size.

Signed-off-by: default avatarWei Wang <wei.w.wang@intel.com>
Reviewed-by: default avatarPeter Xu <peterx@redhat.com>
Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
parent ee555cdf
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -2169,7 +2169,6 @@ static void migration_update_counters(MigrationState *s,
                                      int64_t current_time)
{
    uint64_t transferred, time_spent;
    int64_t threshold_size;
    double bandwidth;

    if (current_time < s->iteration_start_time + BUFFER_DELAY) {
@@ -2179,7 +2178,7 @@ static void migration_update_counters(MigrationState *s,
    transferred = qemu_ftell(s->to_dst_file) - s->iteration_initial_bytes;
    time_spent = current_time - s->iteration_start_time;
    bandwidth = (double)transferred / time_spent;
    threshold_size = bandwidth * s->parameters.downtime_limit;
    s->threshold_size = bandwidth * s->parameters.downtime_limit;

    s->mbps = (((double) transferred * 8.0) /
               ((double) time_spent / 1000.0)) / 1000.0 / 1000.0;
@@ -2199,7 +2198,7 @@ static void migration_update_counters(MigrationState *s,
    s->iteration_initial_bytes = qemu_ftell(s->to_dst_file);

    trace_migrate_transferred(transferred, time_spent,
                              bandwidth, threshold_size);
                              bandwidth, s->threshold_size);
}

/* Migration thread iteration status */