Skip to content
This repository has been archived by the owner on Apr 13, 2019. It is now read-only.

Commit

Permalink
migration: update recv bitmap only on dest vm
Browse files Browse the repository at this point in the history
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 <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Juan Quintela <[email protected]>
Signed-off-by: Dr. David Alan Gilbert <[email protected]>
  • Loading branch information
xzpeter authored and dagrh committed Jul 24, 2018
1 parent 67fa1f5 commit 814bb08
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions migration/ram.c
Original file line number Diff line number Diff line change
Expand Up @@ -2827,8 +2827,15 @@ int ram_discard_range(const char *rbname, uint64_t start, size_t length)
goto err;
}

bitmap_clear(rb->receivedmap, start >> qemu_target_page_bits(),
length >> qemu_target_page_bits());
/*
* 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:
Expand Down

0 comments on commit 814bb08

Please sign in to comment.