aboutsummaryrefslogtreecommitdiff
path: root/io
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2019-08-20 22:13:28 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2019-08-21 16:31:58 +0200
commitb960fc1796fb078c21121abf01499603b66b3f57 (patch)
treeabada0bbf5bac90aff7e066c1a89fcc1984dc993 /io
parent264ef5a5c52c249ff51a16d141fc03df71714a13 (diff)
memory: Fix up memory_region_{add|del}_coalescing
The old memory_region_{add|clear}_coalescing() has some defects because they both changed mr->coalesced before updating the regions using memory_region_update_coalesced_range_as(). Then when the regions were updated in memory_region_update_coalesced_range_as() the mr->coalesced will always be either one more or one less. So: - For memory_region_add_coalescing: it'll always trying to remove the newly added coalesced region while it shouldn't, and, - For memory_region_clear_coalescing: when it calls the update there will be no coalesced ranges on mr->coalesced because they were all removed before hand so the update will probably do nothing for real. Let's fix this. Now we've got flat_range_coalesced_io_notify() to notify a single CoalescedMemoryRange instance change, so use it in the existing memory_region_update_coalesced_range() logic by only notify either an addition or deletion. Then we hammer both the memory_region_{add|clear}_coalescing() to use it. Fixes: 3ac7d43a6fbb5d4a3 Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20190820141328.10009-5-peterx@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'io')
0 files changed, 0 insertions, 0 deletions