Skip to content
This repository has been archived by the owner on Apr 13, 2019. It is now read-only.

Commit

Permalink
migration: disallow recovery for release-ram
Browse files Browse the repository at this point in the history
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 <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Juan Quintela <[email protected]>
Signed-off-by: Dr. David Alan Gilbert <[email protected]>
  • Loading branch information
xzpeter authored and dagrh committed Jul 24, 2018
1 parent 814bb08 commit 97ca211
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions migration/migration.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 97ca211

Please sign in to comment.