migration: Make PageSearchStatus part of RAMState
authorPeter Xu <peterx@redhat.com>
Tue, 11 Oct 2022 21:55:55 +0000 (17:55 -0400)
committerJuan Quintela <quintela@redhat.com>
Thu, 15 Dec 2022 09:30:37 +0000 (10:30 +0100)
commitf166876423a4c8ba706e31075e21ae4ff92b4332
treed184046cc374fc0e7525bdbc0300f3bcb340dfa9
parentebd88a49736f4e3af0aa4004ceb0980698659ebe
migration: Make PageSearchStatus part of RAMState

We used to allocate PSS structure on the stack for precopy when sending
pages.  Make it static, so as to describe per-channel ram migration status.

Here we declared RAM_CHANNEL_MAX instances, preparing for postcopy to use
it, even though this patch has not yet to start using the 2nd instance.

This should not have any functional change per se, but it already starts to
export PSS information via the RAMState, so that e.g. one PSS channel can
start to reference the other PSS channel.

Always protect PSS access using the same RAMState.bitmap_mutex.  We already
do so, so no code change needed, just some comment update.  Maybe we should
consider renaming bitmap_mutex some day as it's going to be a more commonly
and big mutex we use for ram states, but just leave it for later.

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
migration/ram.c