summaryrefslogtreecommitdiff
path: root/qmp.c
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2016-02-18 13:16:49 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2016-02-22 18:40:28 +0100
commit65d64f362326a57b590b8b76e3422030a2aa5c44 (patch)
tree625299fda2cd5b6bd8f213b1603b0bd0905613df /qmp.c
parentbaf28f57e2dec63eebfcd3c00f8d4dea9fcde21e (diff)
downloadqemu-65d64f362326a57b590b8b76e3422030a2aa5c44.tar.gz
qemu-65d64f362326a57b590b8b76e3422030a2aa5c44.tar.bz2
qemu-65d64f362326a57b590b8b76e3422030a2aa5c44.zip
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 'qmp.c')
-rw-r--r--qmp.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/qmp.c b/qmp.c
index 9a93d5e246..3f16a77b44 100644
--- a/qmp.c
+++ b/qmp.c
@@ -103,6 +103,13 @@ void qmp_quit(Error **errp)
void qmp_stop(Error **errp)
{
+ /* 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;
+ }
+
if (runstate_check(RUN_STATE_INMIGRATE)) {
autostart = 0;
} else {
@@ -175,6 +182,13 @@ void qmp_cont(Error **errp)
BlockBackend *blk;
BlockDriverState *bs;
+ /* 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;
+ }
+
if (runstate_needs_reset()) {
error_setg(errp, "Resetting the Virtual Machine is required");
return;