diff options
author | Peter Xu <peterx@redhat.com> | 2016-02-18 13:16:49 +0800 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-11-29 19:45:30 -0600 |
commit | 58095b720aa575198d1109db2eef3b95c62b0b2b (patch) | |
tree | ddde9cdd21ddf5aa2a92151211290c3f2cd31969 /dump.c | |
parent | f562dfa2e062e2641460b76f7a8b5817f3116490 (diff) | |
download | hqemu-58095b720aa575198d1109db2eef3b95c62b0b2b.zip hqemu-58095b720aa575198d1109db2eef3b95c62b0b2b.tar.gz |
dump-guest-memory: add dump_in_progress() helper function
For now, it has no effect. It will be used in dump detach support.
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-Id: <1455772616-8668-5-git-send-email-peterx@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'dump.c')
-rw-r--r-- | dump.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -1450,6 +1450,12 @@ static void dump_state_prepare(DumpState *s) *s = (DumpState) { .status = DUMP_STATUS_ACTIVE }; } +bool dump_in_progress(void) +{ + DumpState *state = &dump_state_global; + return (state->status == DUMP_STATUS_ACTIVE); +} + static void dump_init(DumpState *s, int fd, bool has_format, DumpGuestMemoryFormat format, bool paging, bool has_filter, int64_t begin, int64_t length, Error **errp) @@ -1628,6 +1634,13 @@ void qmp_dump_guest_memory(bool paging, const char *file, DumpState *s; Error *local_err = NULL; + /* if there is a dump in background, we should wait until the dump + * finished */ + if (dump_in_progress()) { + error_setg(errp, "There is a dump in process, please wait."); + return; + } + /* * kdump-compressed format need the whole memory dumped, so paging or * filter is not supported here. |