[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH V7 01/12] cpus: vm_was_suspended
From: |
Steve Sistare |
Subject: |
[PATCH V7 01/12] cpus: vm_was_suspended |
Date: |
Wed, 6 Dec 2023 09:23:26 -0800 |
Add a state variable to remember if a vm previously transitioned into a
suspended state.
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
---
include/sysemu/runstate.h | 2 ++
system/cpus.c | 15 +++++++++++++++
2 files changed, 17 insertions(+)
diff --git a/include/sysemu/runstate.h b/include/sysemu/runstate.h
index c8c2bd8..88a67e2 100644
--- a/include/sysemu/runstate.h
+++ b/include/sysemu/runstate.h
@@ -51,6 +51,8 @@ int vm_prepare_start(bool step_pending);
int vm_stop(RunState state);
int vm_stop_force_state(RunState state);
int vm_shutdown(void);
+void vm_set_suspended(bool suspended);
+bool vm_get_suspended(void);
typedef enum WakeupReason {
/* Always keep QEMU_WAKEUP_REASON_NONE = 0 */
diff --git a/system/cpus.c b/system/cpus.c
index a444a74..9f631ab 100644
--- a/system/cpus.c
+++ b/system/cpus.c
@@ -259,6 +259,21 @@ void cpu_interrupt(CPUState *cpu, int mask)
}
}
+/*
+ * True if the vm was previously suspended, and has not been woken or reset.
+ */
+static int vm_was_suspended;
+
+void vm_set_suspended(bool suspended)
+{
+ vm_was_suspended = suspended;
+}
+
+bool vm_get_suspended(void)
+{
+ return vm_was_suspended;
+}
+
static int do_vm_stop(RunState state, bool send_stop)
{
int ret = 0;
--
1.8.3.1
- [PATCH V7 10/12] tests/qtest: option to suspend during migration, (continued)
- [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
- Re: [PATCH V7 00/12] fix migration of suspended runstate, Steven Sistare, 2023/12/06
- [PATCH V7 00/12] fix migration of suspended runstate, Steve Sistare, 2023/12/06
- [PATCH V7 01/12] cpus: vm_was_suspended,
Steve Sistare <=
- [PATCH V7 04/12] cpus: vm_resume, Steve Sistare, 2023/12/06
- [PATCH V7 03/12] cpus: check running not RUN_STATE_RUNNING, Steve Sistare, 2023/12/06
- [PATCH V7 02/12] cpus: stop vm in suspended runstate, Steve Sistare, 2023/12/06
- Re: [PATCH V7 02/12] cpus: stop vm in suspended runstate, Philippe Mathieu-Daudé, 2023/12/06
- Re: [PATCH V7 02/12] cpus: stop vm in suspended runstate, Steven Sistare, 2023/12/06
- Re: [PATCH V7 02/12] cpus: stop vm in suspended runstate, Philippe Mathieu-Daudé, 2023/12/06
- Re: [PATCH V7 02/12] cpus: stop vm in suspended runstate, Philippe Mathieu-Daudé, 2023/12/06
- Re: [PATCH V7 02/12] cpus: stop vm in suspended runstate, Peter Xu, 2023/12/11
- Re: [PATCH V7 02/12] cpus: stop vm in suspended runstate, Steven Sistare, 2023/12/11
[PATCH V7 07/12] migration: preserve suspended for snapshot, Steve Sistare, 2023/12/06