diff options
author | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2016-06-13 12:16:40 +0100 |
---|---|---|
committer | Amit Shah <amit.shah@redhat.com> | 2016-06-16 09:50:07 +0530 |
commit | d688c62d0928c46437b6b95848922398674538c8 (patch) | |
tree | 9dcb63d363a2ef3b9e2fd55204d0ce13b8d9fac2 /migration | |
parent | 49237b856ae58ee7955be0b959c504c51b014f20 (diff) |
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 <dgilbert@redhat.com>
Reviewed-by: Denis V. Lunev <den@openvz.org>
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 <amit.shah@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r-- | migration/ram.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/migration/ram.c b/migration/ram.c index 844ea4694f..5f929d6195 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; |