diff options
author | Wei Yang <richardw.yang@linux.intel.com> | 2019-06-27 10:08:22 +0800 |
---|---|---|
committer | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2019-08-14 17:33:14 +0100 |
commit | a162b572e9e5a85c440656fe97d7a8b133257379 (patch) | |
tree | ccd3f32191a89b13d9dacc0418842f7061bd6ef3 /migration/ram.c | |
parent | 33a5cb6202f05bf32a870a17c2d9b6d6be6e52f0 (diff) |
migration/postcopy: discard_length must not be 0
Since we break the loop when there is no more page to discard, we are
sure the following process would find some page to discard.
It is not necessary to check it again.
Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
Message-Id: <20190627020822.15485-4-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/ram.c')
-rw-r--r-- | migration/ram.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/migration/ram.c b/migration/ram.c index 8a97dadec4..4bb5e24459 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2877,9 +2877,7 @@ static int postcopy_send_discard_bm_ram(MigrationState *ms, } else { discard_length = zero - one; } - if (discard_length) { - postcopy_discard_send_range(ms, pds, one, discard_length); - } + postcopy_discard_send_range(ms, pds, one, discard_length); current = one + discard_length; } |