Skip to content

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 <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>
  • 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
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.