From bac3b21218925006e1f7d3cae564afb1e9aeb8ee Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Mon, 24 Apr 2017 16:50:35 +0200 Subject: migration: Move postcopy stuff to postcopy-ram.c Yes, we don't have a good place to put that stuff. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- migration/postcopy-ram.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'migration/postcopy-ram.c') diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index cdadaf6578..a0489f6542 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -784,3 +784,21 @@ void postcopy_discard_send_finish(MigrationState *ms, PostcopyDiscardState *pds) g_free(pds); } + +/* + * Current state of incoming postcopy; note this is not part of + * MigrationIncomingState since it's state is used during cleanup + * at the end as MIS is being freed. + */ +static PostcopyState incoming_postcopy_state; + +PostcopyState postcopy_state_get(void) +{ + return atomic_mb_read(&incoming_postcopy_state); +} + +/* Set the state and return the old state */ +PostcopyState postcopy_state_set(PostcopyState new_state) +{ + return atomic_xchg(&incoming_postcopy_state, new_state); +} -- cgit v1.2.1