diff options
author | Peter Xu <peterx@redhat.com> | 2018-07-23 20:33:02 +0800 |
---|---|---|
committer | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2018-07-24 17:10:41 +0100 |
commit | 814bb08f177af8dc67e155f0ad622fb6366c3b85 (patch) | |
tree | 96ebbdfbb426e0c3aa606d69b437ff444c99039d | |
parent | 67fa1f5700248fc66d5b1526c268737e29892b86 (diff) |
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>
-rw-r--r-- | migration/ram.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/migration/ram.c b/migration/ram.c index fdd108475c..24dea2730c 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -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: |