diff mbox

[v2,1/1] Disallow outward migration while awaiting incoming migration

Message ID 1397491439-17820-1-git-send-email-dgilbert@redhat.com
State New
Headers show

Commit Message

Dr. David Alan Gilbert April 14, 2014, 4:03 p.m. UTC
From: "Dr. David Alan Gilbert" <dgilbert@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 <dgilbert@redhat.com>
---
v2
   Just use error_setg rather than adding a new QERR_

 migration.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Andreas Färber April 14, 2014, 4:06 p.m. UTC | #1
Am 14.04.2014 18:03, schrieb Dr. David Alan Gilbert (git):
> From: "Dr. David Alan Gilbert" <dgilbert@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 <dgilbert@redhat.com>

FWIW,

Reviewed-by: Andreas Färber <afaerber@suse.de>

Thanks,
Andreas
Eric Blake April 14, 2014, 4:07 p.m. UTC | #2
On 04/14/2014 10:03 AM, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@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 <dgilbert@redhat.com>
> ---
> v2
>    Just use error_setg rather than adding a new QERR_
> 
>  migration.c | 5 +++++
>  1 file changed, 5 insertions(+)

Reviewed-by: Eric Blake <eblake@redhat.com>
diff mbox

Patch

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;
     }