From: Wei Yang Date: Thu, 27 Jun 2019 02:08:22 +0000 (+0800) Subject: migration/postcopy: discard_length must not be 0 X-Git-Tag: v4.2.0-rc0~238^2~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a162b572e9e5a85c440656fe97d7a8b133257379;p=thirdparty%2Fqemu.git 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 Message-Id: <20190627020822.15485-4-richardw.yang@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- diff --git a/migration/ram.c b/migration/ram.c index 8a97dadec49..4bb5e244595 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; }