aboutsummaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
authorWei Yang <richardw.yang@linux.intel.com>2019-07-18 16:37:47 +0800
committerDr. David Alan Gilbert <dgilbert@redhat.com>2019-08-14 17:33:14 +0100
commit52aec70923a19e73f7ecf5da484a9fd1b07634f5 (patch)
tree2f5ef2b817cc5726ad744e9b49d9c4fb88f80ccb /migration
parent305b6f8431f0b612649bffe1fbfde760a5cd9300 (diff)
downloadqemu-52aec70923a19e73f7ecf5da484a9fd1b07634f5.zip
qemu-52aec70923a19e73f7ecf5da484a9fd1b07634f5.tar.gz
qemu-52aec70923a19e73f7ecf5da484a9fd1b07634f5.tar.bz2
migration/postcopy: start_postcopy could be true only when migrate_postcopy() return true
There is only one place to set start_postcopy to true, qmp_migrate_start_postcopy(), which make sure start_postcopy could be set to true when migrate_postcopy() return true. So start_postcopy is true implies the other one. Signed-off-by: Wei Yang <richardw.yang@linux.intel.com> Message-Id: <20190718083747.5859-1-richardw.yang@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r--migration/migration.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/migration/migration.c b/migration/migration.c
index 7c66da3..8331e62 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3103,8 +3103,7 @@ static MigIterateState migration_iteration_run(MigrationState *s)
if (pending_size && pending_size >= s->threshold_size) {
/* Still a significant amount to transfer */
- if (migrate_postcopy() && !in_postcopy &&
- pend_pre <= s->threshold_size &&
+ if (!in_postcopy && pend_pre <= s->threshold_size &&
atomic_read(&s->start_postcopy)) {
if (postcopy_start(s)) {
error_report("%s: postcopy failed to start", __func__);