qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org
Cc: quintela@redhat.com, peterx@redhat.com, kraxel@redhat.com,
	lidongchen@tencent.com
Subject: [Qemu-devel] [PULL 5/7] migration: disallow recovery for release-ram
Date: Tue, 24 Jul 2018 19:34:52 +0100	[thread overview]
Message-ID: <20180724183454.120276-6-dgilbert@redhat.com> (raw)
In-Reply-To: <20180724183454.120276-1-dgilbert@redhat.com>

From: Peter Xu <peterx@redhat.com>

Postcopy recovery won't work well with release-ram capability since
release-ram will drop the page buffer as long as the page is put into
the send buffer.  So if there is a network failure happened, any page
buffers that have not yet reached the destination VM but have already
been sent from the source VM will be lost forever.  Let's refuse the
client from resuming such a postcopy migration.  Luckily release-ram was
designed to only be used when src and destination VMs are on the same
host, so it should be fine.

Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20180723123305.24792-3-peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 migration/migration.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/migration/migration.c b/migration/migration.c
index db6bde7453..bfc4d09aae 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1629,6 +1629,25 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc,
                        "paused migration");
             return false;
         }
+
+        /*
+         * Postcopy recovery won't work well with release-ram
+         * capability since release-ram will drop the page buffer as
+         * long as the page is put into the send buffer.  So if there
+         * is a network failure happened, any page buffers that have
+         * not yet reached the destination VM but have already been
+         * sent from the source VM will be lost forever.  Let's refuse
+         * the client from resuming such a postcopy migration.
+         * Luckily release-ram was designed to only be used when src
+         * and destination VMs are on the same host, so it should be
+         * fine.
+         */
+        if (migrate_release_ram()) {
+            error_setg(errp, "Postcopy recovery cannot work "
+                       "when release-ram capability is set");
+            return false;
+        }
+
         /* This is a resume, skip init status */
         return true;
     }
-- 
2.17.1

  parent reply	other threads:[~2018-07-24 18:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-24 18:34 [Qemu-devel] [PULL 0/7] migration queue for 3.0 Dr. David Alan Gilbert (git)
2018-07-24 18:34 ` [Qemu-devel] [PULL 1/7] migration: fix potential overflow in multifd send Dr. David Alan Gilbert (git)
2018-07-24 18:34 ` [Qemu-devel] [PULL 2/7] migrate: Fix cancelling state warning Dr. David Alan Gilbert (git)
2018-07-24 18:34 ` [Qemu-devel] [PULL 3/7] audio/hda: Fix migration Dr. David Alan Gilbert (git)
2018-07-24 18:34 ` [Qemu-devel] [PULL 4/7] migration: update recv bitmap only on dest vm Dr. David Alan Gilbert (git)
2018-07-24 18:34 ` Dr. David Alan Gilbert (git) [this message]
2018-07-24 18:34 ` [Qemu-devel] [PULL 6/7] tests: only update last_byte when at the edge Dr. David Alan Gilbert (git)
2018-07-24 18:34 ` [Qemu-devel] [PULL 7/7] migration: fix duplicate initialization for expected_downtime and cleanup_bh Dr. David Alan Gilbert (git)
2018-07-24 21:04 ` [Qemu-devel] [PULL 0/7] migration queue for 3.0 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=20180724183454.120276-6-dgilbert@redhat.com \
    --to=dgilbert@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=lidongchen@tencent.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /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).