瀏覽代碼

include: move dump_in_progress() to runstate.h

Along with other state tracking functions. Rename it for consistency.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220323155743.1585078-21-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Marc-André Lureau 3 年之前
父節點
當前提交
544803c7a1
共有 4 個文件被更改,包括 5 次插入8 次删除
  1. 2 2
      dump/dump.c
  2. 0 4
      include/qemu-common.h
  3. 1 0
      include/sysemu/runstate.h
  4. 2 2
      monitor/qmp-cmds.c

+ 2 - 2
dump/dump.c

@@ -1564,7 +1564,7 @@ static void dump_state_prepare(DumpState *s)
     *s = (DumpState) { .status = DUMP_STATUS_ACTIVE };
     *s = (DumpState) { .status = DUMP_STATUS_ACTIVE };
 }
 }
 
 
-bool dump_in_progress(void)
+bool qemu_system_dump_in_progress(void)
 {
 {
     DumpState *state = &dump_state_global;
     DumpState *state = &dump_state_global;
     return (qatomic_read(&state->status) == DUMP_STATUS_ACTIVE);
     return (qatomic_read(&state->status) == DUMP_STATUS_ACTIVE);
@@ -1930,7 +1930,7 @@ void qmp_dump_guest_memory(bool paging, const char *file,
 
 
     /* if there is a dump in background, we should wait until the dump
     /* if there is a dump in background, we should wait until the dump
      * finished */
      * finished */
-    if (dump_in_progress()) {
+    if (qemu_system_dump_in_progress()) {
         error_setg(errp, "There is a dump in process, please wait.");
         error_setg(errp, "There is a dump in process, please wait.");
         return;
         return;
     }
     }

+ 0 - 4
include/qemu-common.h

@@ -76,8 +76,4 @@ int parse_debug_env(const char *name, int max, int initial);
 
 
 void page_size_init(void);
 void page_size_init(void);
 
 
-/* returns non-zero if dump is in progress, otherwise zero is
- * returned. */
-bool dump_in_progress(void);
-
 #endif
 #endif

+ 1 - 0
include/sysemu/runstate.h

@@ -69,6 +69,7 @@ void qemu_system_killed(int signal, pid_t pid);
 void qemu_system_reset(ShutdownCause reason);
 void qemu_system_reset(ShutdownCause reason);
 void qemu_system_guest_panicked(GuestPanicInformation *info);
 void qemu_system_guest_panicked(GuestPanicInformation *info);
 void qemu_system_guest_crashloaded(GuestPanicInformation *info);
 void qemu_system_guest_crashloaded(GuestPanicInformation *info);
+bool qemu_system_dump_in_progress(void);
 
 
 #endif
 #endif
 
 

+ 2 - 2
monitor/qmp-cmds.c

@@ -85,7 +85,7 @@ void qmp_stop(Error **errp)
 {
 {
     /* if there is a dump in background, we should wait until the dump
     /* if there is a dump in background, we should wait until the dump
      * finished */
      * finished */
-    if (dump_in_progress()) {
+    if (qemu_system_dump_in_progress()) {
         error_setg(errp, "There is a dump in process, please wait.");
         error_setg(errp, "There is a dump in process, please wait.");
         return;
         return;
     }
     }
@@ -115,7 +115,7 @@ void qmp_cont(Error **errp)
 
 
     /* if there is a dump in background, we should wait until the dump
     /* if there is a dump in background, we should wait until the dump
      * finished */
      * finished */
-    if (dump_in_progress()) {
+    if (qemu_system_dump_in_progress()) {
         error_setg(errp, "There is a dump in process, please wait.");
         error_setg(errp, "There is a dump in process, please wait.");
         return;
         return;
     }
     }