From: Dr. David Alan Gilbert Date: Mon, 13 Jun 2016 11:16:40 +0000 (+0100) Subject: Postcopy: Avoid 0 length discards X-Git-Tag: TizenStudio_2.0_p4.0~6^2~12^2~6^2~201^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d688c62d0928c46437b6b95848922398674538c8;p=sdk%2Femulator%2Fqemu.git Postcopy: Avoid 0 length discards The discard code in migration/ram.c would send request for zero length discards in the case where no discards were needed. It doesn't appear to have had any bad effect. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Denis V. Lunev Message-id: 1465816605-29488-2-git-send-email-dgilbert@redhat.com Message-Id: <1465816605-29488-2-git-send-email-dgilbert@redhat.com> Signed-off-by: Amit Shah --- diff --git a/migration/ram.c b/migration/ram.c index 844ea46..5f929d6 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1557,7 +1557,9 @@ static int postcopy_send_discard_bm_ram(MigrationState *ms, } else { discard_length = zero - one; } - postcopy_discard_send_range(ms, pds, one, discard_length); + if (discard_length) { + postcopy_discard_send_range(ms, pds, one, discard_length); + } current = one + discard_length; } else { current = one;