From: "Dr. David Alan Gilbert" <dgilb...@redhat.com>

QEMU will assert if you attempt to start an outgoing migration on
a QEMU that's sitting waiting for an incoming migration (started
with -incoming), so disallow it with a proper error.

(This is a fix for https://bugzilla.redhat.com/show_bug.cgi?id=1086987 )

Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com>
Reviewed-by: Andreas Färber <afaer...@suse.de>
Reviewed-by: Eric Blake <ebl...@redhat.com>
Signed-off-by: Juan Quintela <quint...@redhat.com>
---
 migration.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/migration.c b/migration.c
index bd1fb91..ac23275 100644
--- a/migration.c
+++ b/migration.c
@@ -419,6 +419,11 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
         return;
     }

+    if (runstate_check(RUN_STATE_INMIGRATE)) {
+        error_setg(errp, "Guest is waiting for an incoming migration");
+        return;
+    }
+
     if (qemu_savevm_state_blocked(errp)) {
         return;
     }
-- 
1.9.0


Reply via email to