aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>2023-05-17 15:37:48 +0300
committerJuan Quintela <quintela@redhat.com>2023-06-02 01:03:19 +0200
commit242b74eb69d0e53b25e294331a192b7a458b8e46 (patch)
tree4201a463dac8bd7d237550ba6c4c2954f2d3272a
parent9eb400cdd7b0940bd696aa01462dd53004ae04e9 (diff)
downloadqemu-242b74eb69d0e53b25e294331a192b7a458b8e46.zip
qemu-242b74eb69d0e53b25e294331a192b7a458b8e46.tar.gz
qemu-242b74eb69d0e53b25e294331a192b7a458b8e46.tar.bz2
runstate: add runstate_get()
It's necessary to restore the state after failed/cancelled migration in further commit. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20230517123752.21615-2-vsementsov@yandex-team.ru> Signed-off-by: Juan Quintela <quintela@redhat.com>
-rw-r--r--include/sysemu/runstate.h1
-rw-r--r--softmmu/runstate.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/include/sysemu/runstate.h b/include/sysemu/runstate.h
index f3ed525..85f5d9a 100644
--- a/include/sysemu/runstate.h
+++ b/include/sysemu/runstate.h
@@ -6,6 +6,7 @@
bool runstate_check(RunState state);
void runstate_set(RunState new_state);
+RunState runstate_get(void);
bool runstate_is_running(void);
bool runstate_needs_reset(void);
bool runstate_store(char *str, size_t size);
diff --git a/softmmu/runstate.c b/softmmu/runstate.c
index 2f2396c..1e6f0bc 100644
--- a/softmmu/runstate.c
+++ b/softmmu/runstate.c
@@ -221,6 +221,11 @@ void runstate_set(RunState new_state)
current_run_state = new_state;
}
+RunState runstate_get(void)
+{
+ return current_run_state;
+}
+
bool runstate_is_running(void)
{
return runstate_check(RUN_STATE_RUNNING);