[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH V7 08/12] migration: preserve suspended for bg_migration
From: |
Steve Sistare |
Subject: |
[PATCH V7 08/12] migration: preserve suspended for bg_migration |
Date: |
Wed, 6 Dec 2023 09:12:41 -0800 |
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>
---
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 8124811..2cc7e2a 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 ca9eb54..621a023 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 },
--
1.8.3.1
- [PATCH 03/14] cpus: vm_was_suspended, (continued)
- [PATCH 03/14] cpus: vm_was_suspended, Steve Sistare, 2023/12/06
- [PATCH V7 04/12] cpus: vm_resume, Steve Sistare, 2023/12/06
- [PATCH 05/14] cpus: check running not RUN_STATE_RUNNING, Steve Sistare, 2023/12/06
- [PATCH 06/14] cpus: vm_resume, Steve Sistare, 2023/12/06
- [PATCH V7 06/12] migration: preserve suspended runstate, Steve Sistare, 2023/12/06
- [PATCH 02/14] temp: allow python 3.6 qemu-8.2, Steve Sistare, 2023/12/06
- [PATCH V7 05/12] migration: propagate suspended runstate, Steve Sistare, 2023/12/06
- [PATCH V7 07/12] migration: preserve suspended for snapshot, Steve Sistare, 2023/12/06
- [PATCH 08/14] migration: preserve suspended runstate, Steve Sistare, 2023/12/06
- [PATCH 09/14] migration: preserve suspended for snapshot, Steve Sistare, 2023/12/06
- [PATCH V7 08/12] migration: preserve suspended for bg_migration,
Steve Sistare <=
- [PATCH 10/14] migration: preserve suspended for bg_migration, Steve Sistare, 2023/12/06
- [PATCH V7 09/12] tests/qtest: migration events, Steve Sistare, 2023/12/06
- [PATCH V7 10/12] tests/qtest: option to suspend during migration, Steve Sistare, 2023/12/06
- [PATCH V7 11/12] tests/qtest: precopy migration with suspend, Steve Sistare, 2023/12/06
- [PATCH 12/14] tests/qtest: option to suspend during migration, Steve Sistare, 2023/12/06
- [PATCH 07/14] migration: propagate suspended runstate, Steve Sistare, 2023/12/06
- [PATCH 11/14] tests/qtest: migration events, Steve Sistare, 2023/12/06
- [PATCH 13/14] tests/qtest: precopy migration with suspend, Steve Sistare, 2023/12/06
- [PATCH 14/14] tests/qtest: postcopy migration with suspend, Steve Sistare, 2023/12/06
- [PATCH V7 12/12] tests/qtest: postcopy migration with suspend, Steve Sistare, 2023/12/06