diff options
author | Fabiano Rosas <farosas@suse.de> | 2024-02-26 11:33:35 -0300 |
---|---|---|
committer | Peter Xu <peterx@redhat.com> | 2024-02-28 11:31:28 +0800 |
commit | 63f64d77f04337c21564fead6e9a55fdb2c80740 (patch) | |
tree | 591ac9ed8f1fd7a49b16131e751920f68bf1685e /ui/input-keymap.c | |
parent | cbdafc1b348b9a9dd6e0e6c82ff3e281c93205fe (diff) | |
download | qemu-63f64d77f04337c21564fead6e9a55fdb2c80740.zip qemu-63f64d77f04337c21564fead6e9a55fdb2c80740.tar.gz qemu-63f64d77f04337c21564fead6e9a55fdb2c80740.tar.bz2 |
migration: Fix qmp_query_migrate mbps value
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 <farosas@suse.de>
Link: https://lore.kernel.org/r/20240226143335.14282-1-farosas@suse.de
Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'ui/input-keymap.c')
0 files changed, 0 insertions, 0 deletions