[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/26] migration: preserve suspended for bg_migration
|
From: |
peterx |
|
Subject: |
[PULL 10/26] migration: preserve suspended for bg_migration |
|
Date: |
Thu, 4 Jan 2024 12:31:55 +0800 |
From: Steve Sistare <steven.sistare@oracle.com>
Do not wake a suspended guest during bg_migration, and restore the prior
state at finish rather than unconditionally running. Allow the additional
state transitions that occur.
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
Link:
1704312341-66640-9-git-send-email-steven.sistare@oracle.com">https://lore.kernel.org/r/1704312341-66640-9-git-send-email-steven.sistare@oracle.com
Signed-off-by: Peter Xu <peterx@redhat.com>
---
migration/migration.c | 7 +------
system/runstate.c | 1 +
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index 8124811045..2cc7e2a56c 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3390,7 +3390,7 @@ static void bg_migration_vm_start_bh(void *opaque)
qemu_bh_delete(s->vm_start_bh);
s->vm_start_bh = NULL;
- vm_start();
+ vm_resume(s->vm_old_state);
migration_downtime_end(s);
}
@@ -3462,11 +3462,6 @@ static void *bg_migration_thread(void *opaque)
qemu_mutex_lock_iothread();
- /*
- * If VM is currently in suspended state, then, to make a valid runstate
- * transition in vm_stop_force_state() we need to wakeup it up.
- */
- qemu_system_wakeup_request(QEMU_WAKEUP_REASON_OTHER, NULL);
s->vm_old_state = runstate_get();
global_state_store();
diff --git a/system/runstate.c b/system/runstate.c
index ca9eb54cde..621a023120 100644
--- a/system/runstate.c
+++ b/system/runstate.c
@@ -168,6 +168,7 @@ static const RunStateTransition runstate_transitions_def[]
= {
{ RUN_STATE_SUSPENDED, RUN_STATE_PAUSED},
{ RUN_STATE_SUSPENDED, RUN_STATE_SAVE_VM },
{ RUN_STATE_SUSPENDED, RUN_STATE_RESTORE_VM },
+ { RUN_STATE_SUSPENDED, RUN_STATE_SHUTDOWN },
{ RUN_STATE_WATCHDOG, RUN_STATE_RUNNING },
{ RUN_STATE_WATCHDOG, RUN_STATE_FINISH_MIGRATE },
--
2.41.0
- [PULL 00/26] Migration 20240104 patches, peterx, 2024/01/03
- [PULL 01/26] MAINTAINERS: Leaving Migration, peterx, 2024/01/03
- [PULL 02/26] MAINTAINERS: Remove myself as reviewer from Live Migration, peterx, 2024/01/03
- [PULL 03/26] cpus: vm_was_suspended, peterx, 2024/01/03
- [PULL 04/26] cpus: stop vm in suspended runstate, peterx, 2024/01/03
- [PULL 05/26] cpus: check running not RUN_STATE_RUNNING, peterx, 2024/01/03
- [PULL 06/26] cpus: vm_resume, peterx, 2024/01/03
- [PULL 07/26] migration: propagate suspended runstate, peterx, 2024/01/03
- [PULL 08/26] migration: preserve suspended runstate, peterx, 2024/01/03
- [PULL 09/26] migration: preserve suspended for snapshot, peterx, 2024/01/03
- [PULL 10/26] migration: preserve suspended for bg_migration,
peterx <=
- [PULL 11/26] tests/qtest: migration events, peterx, 2024/01/03
- [PULL 12/26] tests/qtest: option to suspend during migration, peterx, 2024/01/03
- [PULL 13/26] tests/qtest: precopy migration with suspend, peterx, 2024/01/03
- [PULL 14/26] tests/qtest: postcopy migration with suspend, peterx, 2024/01/03
- [PULL 15/26] migration: Remove migrate_max_downtime() declaration, peterx, 2024/01/03
- [PULL 17/26] migration: Refactor migration_incoming_setup(), peterx, 2024/01/03
- [PULL 16/26] migration: Remove nulling of hostname in migrate_init(), peterx, 2024/01/03
- [PULL 19/26] migration/multifd: Fix error message in multifd_recv_initial_packet(), peterx, 2024/01/03
- [PULL 18/26] migration: Remove errp parameter in migration_fd_process_incoming(), peterx, 2024/01/03
- [PULL 20/26] migration/multifd: Simplify multifd_channel_connect() if else statement, peterx, 2024/01/03