diff options
author | Wei Yang <richardw.yang@linux.intel.com> | 2019-07-18 09:25:47 +0800 |
---|---|---|
committer | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2019-08-14 17:33:14 +0100 |
commit | 5d0980a459774a52e3f3729cee0a2562d11026d2 (patch) | |
tree | 2524b91e52252804c8287a548f97d052385edada /migration | |
parent | 6a88eb2b0881c1137b1647147a37de9e818142d8 (diff) |
migration: just pass RAMBlock is enough
RAMBlock->used_length is always passed to migration_bitmap_sync_range(),
which could be retrieved from RAMBlock.
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
Message-Id: <20190718012547.16373-1-richardw.yang@linux.intel.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r-- | migration/ram.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/migration/ram.c b/migration/ram.c index 255f289bbb..97f241d6d9 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1748,11 +1748,10 @@ static inline bool migration_bitmap_clear_dirty(RAMState *rs, } /* Called with RCU critical section */ -static void migration_bitmap_sync_range(RAMState *rs, RAMBlock *rb, - ram_addr_t length) +static void migration_bitmap_sync_range(RAMState *rs, RAMBlock *rb) { rs->migration_dirty_pages += - cpu_physical_memory_sync_dirty_bitmap(rb, 0, length, + cpu_physical_memory_sync_dirty_bitmap(rb, 0, rb->used_length, &rs->num_dirty_pages_period); } @@ -1841,7 +1840,7 @@ static void migration_bitmap_sync(RAMState *rs) qemu_mutex_lock(&rs->bitmap_mutex); rcu_read_lock(); RAMBLOCK_FOREACH_NOT_IGNORED(block) { - migration_bitmap_sync_range(rs, block, block->used_length); + migration_bitmap_sync_range(rs, block); } ram_counters.remaining = ram_bytes_remaining(); rcu_read_unlock(); @@ -4293,7 +4292,7 @@ static void colo_flush_ram_cache(void) memory_global_dirty_log_sync(); rcu_read_lock(); RAMBLOCK_FOREACH_NOT_IGNORED(block) { - migration_bitmap_sync_range(ram_state, block, block->used_length); + migration_bitmap_sync_range(ram_state, block); } rcu_read_unlock(); |