]> git.proxmox.com Git - mirror_qemu.git/commitdiff
Postcopy: Avoid 0 length discards
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Mon, 13 Jun 2016 11:16:40 +0000 (12:16 +0100)
committerAmit Shah <amit.shah@redhat.com>
Thu, 16 Jun 2016 04:20:07 +0000 (09:50 +0530)
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>
migration/ram.c

index 844ea4694f5c1da151bd6fbaa1410a0d1d52beba..5f929d6195d3a852f10be3918903901a44b9f99c 100644 (file)
@@ -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;