runstate: add runstate_get()
authorVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Wed, 17 May 2023 12:37:48 +0000 (15:37 +0300)
committerJuan Quintela <quintela@redhat.com>
Thu, 1 Jun 2023 23:03:19 +0000 (01:03 +0200)
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>
include/sysemu/runstate.h
softmmu/runstate.c

index f3ed52548ea964fd26b9796d23ec2bd8fff12dc9..85f5d9a41978faf1307bdd16f4563e0489bd1e44 100644 (file)
@@ -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);
index 2f2396c819e49ff29f9799b563ed9a423aa223f4..1e6f0bceccff4b781c35fd3e3978d4b0e2c31f8f 100644 (file)
@@ -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);