]> git.proxmox.com Git - mirror_qemu.git/commitdiff
migration/postcopy: discard_length must not be 0
authorWei Yang <richardw.yang@linux.intel.com>
Thu, 27 Jun 2019 02:08:22 +0000 (10:08 +0800)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Wed, 14 Aug 2019 16:33:14 +0000 (17:33 +0100)
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>
migration/ram.c

index 8a97dadec4973cb6b4b7cf1c0b94a0f0b9e3228d..4bb5e244595bff84bc2d2a8187eff96729eee434 100644 (file)
@@ -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;
     }