qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: qemu-devel@nongnu.org
Cc: amit.shah@redhat.com, dgilbert@redhat.com
Subject: [Qemu-devel] [PULL 2/3] migration: announce VM's new home just before VM is runnable
Date: Thu, 15 Oct 2015 08:27:59 +0200	[thread overview]
Message-ID: <1444890480-6371-3-git-send-email-quintela@redhat.com> (raw)
In-Reply-To: <1444890480-6371-1-git-send-email-quintela@redhat.com>

From: Amit Shah <amit.shah@redhat.com>

We were announcing the dest host's IP as our new IP a bit too soon -- if
there were errors detected after this announcement was done, the
migration is failed and the VM could continue running on the src host --
causing problems later.

Move around the qemu_announce_self() call so it's done just before the
VM is runnable.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration/migration.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/migration/migration.c b/migration/migration.c
index 3d40f24..b092f38 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -294,7 +294,6 @@ static void process_incoming_migration_co(void *opaque)
         migrate_decompress_threads_join();
         exit(EXIT_FAILURE);
     }
-    qemu_announce_self();

     /* Make sure all file formats flush their mutable metadata */
     bdrv_invalidate_cache_all(&local_err);
@@ -305,6 +304,12 @@ static void process_incoming_migration_co(void *opaque)
         exit(EXIT_FAILURE);
     }

+    /*
+     * This must happen after all error conditions are dealt with and
+     * we're sure the VM is going to be running on this host.
+     */
+    qemu_announce_self();
+
     /* If global state section was not received or we are in running
        state, we need to obey autostart. Any other state is set with
        runstate_set. */
-- 
2.4.3

  parent reply	other threads:[~2015-10-15  6:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-15  6:27 [Qemu-devel] [PULL 0/3] Migration pull Juan Quintela
2015-10-15  6:27 ` [Qemu-devel] [PULL 1/3] Migration: Generate the completed event only when we complete Juan Quintela
2015-10-15 14:46   ` Eric Blake
2015-10-15 15:07   ` Christian Borntraeger
2015-10-15 16:12     ` Dr. David Alan Gilbert
2015-10-16  8:13     ` Juan Quintela
2015-10-15  6:27 ` Juan Quintela [this message]
2015-10-15  6:28 ` [Qemu-devel] [PULL 3/3] migration: fix deadlock Juan Quintela
2015-10-16 15:23 ` [Qemu-devel] [PULL 0/3] Migration pull Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1444890480-6371-3-git-send-email-quintela@redhat.com \
    --to=quintela@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).