migration: Remove MigrationState from migration_in_postcopy

We need to call for the migrate_get_current() in more that half of the
uses, so call that inside.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
Juan Quintela
2017-03-20 22:25:28 +01:00
parent 6d358d9494
commit 5727309d25
4 changed files with 17 additions and 17 deletions

View File

@@ -1062,14 +1062,16 @@ bool migration_has_failed(MigrationState *s)
s->state == MIGRATION_STATUS_FAILED);
}
bool migration_in_postcopy(MigrationState *s)
bool migration_in_postcopy(void)
{
MigrationState *s = migrate_get_current();
return (s->state == MIGRATION_STATUS_POSTCOPY_ACTIVE);
}
bool migration_in_postcopy_after_devices(MigrationState *s)
{
return migration_in_postcopy(s) && s->postcopy_after_devices;
return migration_in_postcopy() && s->postcopy_after_devices;
}
bool migration_is_idle(MigrationState *s)