On Mon, Feb 26, 2024 at 11:33:35AM -0300, Fabiano Rosas wrote:
> The QMP command query_migrate might see incorrect throughput numbers
> if it runs after we've set the migration completion status but before
> migration_calculate_complete() has updated s->total_time and s->mbps.
> 
> The migration status would show COMPLETED, but the throughput value
> would be the one from the last iteration and not the one from the
> whole migration. This will usually be a larger value due to the time
> period being smaller (one iteration).
> 
> Move migration_calculate_complete() earlier so that the status
> MIGRATION_STATUS_COMPLETED is only emitted after the final counters
> update. Keep everything under the BQL so the QMP thread sees the
> updates as atomic.
> 
> Rename migration_calculate_complete to migration_completion_end to
> reflect its new purpose of also updating s->state.
> 
> Signed-off-by: Fabiano Rosas <faro...@suse.de>

queued, thanks.

-- 
Peter Xu


Reply via email to