migration: update recv bitmap only on dest vm

We shouldn't update the received bitmap if we're the source VM.  This
fixes a breakage when release-ram is enabled on postcopy.

Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20180723123305.24792-2-peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
Peter Xu 2018-07-23 20:33:02 +08:00 committed by Dr. David Alan Gilbert
parent 67fa1f5700
commit 814bb08f17

View File

@ -2827,8 +2827,15 @@ int ram_discard_range(const char *rbname, uint64_t start, size_t length)
goto err;
}
/*
* On source VM, we don't need to update the received bitmap since
* we don't even have one.
*/
if (rb->receivedmap) {
bitmap_clear(rb->receivedmap, start >> qemu_target_page_bits(),
length >> qemu_target_page_bits());
}
ret = ram_block_discard_range(rb, start, length);
err: