aboutsummaryrefslogtreecommitdiff
path: root/migration/migration.c
diff options
context:
space:
mode:
authorSteve Sistare <steven.sistare@oracle.com>2024-03-11 10:48:50 -0700
committerPeter Xu <peterx@redhat.com>2024-03-11 16:28:59 -0400
commit3a6813b68cf21a366522564f83f885bf2657dcc8 (patch)
tree8369a19450510e242f041e5e311b4f40ecc2ee40 /migration/migration.c
parent7dcb3c87d87cbf3359c9bbef8066e5195ee92f4d (diff)
migration: export migration_is_active
Delete the MigrationState parameter from migration_is_active so it can be exported and used without including migration.h. Signed-off-by: Steve Sistare <steven.sistare@oracle.com> Link: https://lore.kernel.org/r/1710179338-294359-4-git-send-email-steven.sistare@oracle.com Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'migration/migration.c')
-rw-r--r--migration/migration.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/migration/migration.c b/migration/migration.c
index af21403bad..17859cbaee 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1406,7 +1406,7 @@ static void migrate_fd_cleanup(MigrationState *s)
qemu_fclose(tmp);
}
- assert(!migration_is_active(s));
+ assert(!migration_is_active());
if (s->state == MIGRATION_STATUS_CANCELLING) {
migrate_set_state(&s->state, MIGRATION_STATUS_CANCELLING,
@@ -1637,8 +1637,10 @@ bool migration_is_idle(void)
return false;
}
-bool migration_is_active(MigrationState *s)
+bool migration_is_active(void)
{
+ MigrationState *s = current_migration;
+
return (s->state == MIGRATION_STATUS_ACTIVE ||
s->state == MIGRATION_STATUS_POSTCOPY_ACTIVE);
}
@@ -3461,7 +3463,7 @@ static void *migration_thread(void *opaque)
trace_migration_thread_setup_complete();
- while (migration_is_active(s)) {
+ while (migration_is_active()) {
if (urgent || !migration_rate_exceeded(s->to_dst_file)) {
MigIterateState iter_state = migration_iteration_run(s);
if (iter_state == MIG_ITERATE_SKIP) {
@@ -3607,7 +3609,7 @@ static void *bg_migration_thread(void *opaque)
migration_bh_schedule(bg_migration_vm_start_bh, s);
bql_unlock();
- while (migration_is_active(s)) {
+ while (migration_is_active()) {
MigIterateState iter_state = bg_migration_iteration_run(s);
if (iter_state == MIG_ITERATE_SKIP) {
continue;