dump-guest-memory: disable dump when in INMIGRATE state
authorPeter Xu <peterx@redhat.com>
Thu, 18 Feb 2016 05:16:51 +0000 (13:16 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 22 Feb 2016 17:40:28 +0000 (18:40 +0100)
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-Id: <1455772616-8668-7-git-send-email-peterx@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
dump.c

diff --git a/dump.c b/dump.c
index fed84a6..923e3a5 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -1654,6 +1654,11 @@ void qmp_dump_guest_memory(bool paging, const char *file,
     DumpState *s;
     Error *local_err = NULL;
 
+    if (runstate_check(RUN_STATE_INMIGRATE)) {
+        error_setg(errp, "Dump not allowed during incoming migration.");
+        return;
+    }
+
     /* if there is a dump in background, we should wait until the dump
      * finished */
     if (dump_in_progress()) {