mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-09 00:07:57 -06:00
migration: Notify COMPLETE once for postcopy
Postcopy invokes qemu_savevm_state_complete_precopy() twice, that means it'll invoke COMPLETE notify twice.. also twice the tracepoints that marking precopy complete. Move that notification (along with the tracepoint) out to the caller, so that postcopy will only notify once right at the start of switchover phase from precopy. When at it, rename it to suite the file now it locates. For precopy, there should have no functional change except the tracepoint has a name change. For the other two users of qemu_savevm_state_complete_precopy(), namely: qemu_savevm_state() and qemu_savevm_live_state(): the notifier shouldn't matter because they're not precopy at all. Now in these two contexts (aka, "savevm", and "colo") sometimes the precopy notifiers will still be invoked, but that's outside the scope of this patch. Signed-off-by: Peter Xu <peterx@redhat.com> Tested-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Juraj Marcin <jmarcin@redhat.com> Link: https://lore.kernel.org/r/20250114230746.3268797-12-peterx@redhat.com Signed-off-by: Fabiano Rosas <farosas@suse.de>
This commit is contained in:
parent
a880ddd8ce
commit
46b0155ecf
3 changed files with 16 additions and 8 deletions
|
@ -131,6 +131,17 @@ static void migration_downtime_end(MigrationState *s)
|
|||
}
|
||||
}
|
||||
|
||||
static void precopy_notify_complete(void)
|
||||
{
|
||||
Error *local_err = NULL;
|
||||
|
||||
if (precopy_notify(PRECOPY_NOTIFY_COMPLETE, &local_err)) {
|
||||
error_report_err(local_err);
|
||||
}
|
||||
|
||||
trace_migration_precopy_complete();
|
||||
}
|
||||
|
||||
static bool migration_needs_multiple_sockets(void)
|
||||
{
|
||||
return migrate_multifd() || migrate_postcopy_preempt();
|
||||
|
@ -2676,6 +2687,8 @@ static int postcopy_start(MigrationState *ms, Error **errp)
|
|||
/* Switchover phase, switch to unlimited */
|
||||
migration_rate_set(RATE_LIMIT_DISABLED);
|
||||
|
||||
precopy_notify_complete();
|
||||
|
||||
/*
|
||||
* Cause any non-postcopiable, but iterative devices to
|
||||
* send out their final data.
|
||||
|
@ -2865,6 +2878,8 @@ static int migration_completion_precopy(MigrationState *s)
|
|||
|
||||
migration_rate_set(RATE_LIMIT_DISABLED);
|
||||
|
||||
precopy_notify_complete();
|
||||
|
||||
ret = qemu_savevm_state_complete_precopy(s->to_dst_file, false);
|
||||
out_unlock:
|
||||
bql_unlock();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue