diff options
author | Will Gyda <vilhelmgyda@gmail.com> | 2024-04-25 17:12:07 +0530 |
---|---|---|
committer | Fabiano Rosas <farosas@suse.de> | 2024-05-08 09:20:57 -0300 |
commit | 62663f08a75dbbddb745c80a00b09e298ede641a (patch) | |
tree | 2c484a880545b136438a501d869b47a7d8c57dc0 | |
parent | 4e66a08546a2588a4667766a1edab9caccf24ce3 (diff) | |
download | qemu-62663f08a75dbbddb745c80a00b09e298ede641a.zip qemu-62663f08a75dbbddb745c80a00b09e298ede641a.tar.gz qemu-62663f08a75dbbddb745c80a00b09e298ede641a.tar.bz2 |
migration/ram.c: API Conversion qemu_mutex_lock(), and qemu_mutex_unlock() to WITH_QEMU_LOCK_GUARD macro
migration/ram.c: API Conversion qemu_mutex_lock(),
and qemu_mutex_unlock() to WITH_QEMU_LOCK_GUARD macro
Signed-off-by: Will Gyda <vilhelmgyda@gmail.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
-rw-r--r-- | migration/ram.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/migration/ram.c b/migration/ram.c index a975c5a..50df1e9 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1066,14 +1066,14 @@ static void migration_bitmap_sync(RAMState *rs, bool last_stage) trace_migration_bitmap_sync_start(); memory_global_dirty_log_sync(last_stage); - qemu_mutex_lock(&rs->bitmap_mutex); - WITH_RCU_READ_LOCK_GUARD() { - RAMBLOCK_FOREACH_NOT_IGNORED(block) { - ramblock_sync_dirty_bitmap(rs, block); + WITH_QEMU_LOCK_GUARD(&rs->bitmap_mutex) { + WITH_RCU_READ_LOCK_GUARD() { + RAMBLOCK_FOREACH_NOT_IGNORED(block) { + ramblock_sync_dirty_bitmap(rs, block); + } + stat64_set(&mig_stats.dirty_bytes_last_sync, ram_bytes_remaining()); } - stat64_set(&mig_stats.dirty_bytes_last_sync, ram_bytes_remaining()); } - qemu_mutex_unlock(&rs->bitmap_mutex); memory_global_after_dirty_log_sync(); trace_migration_bitmap_sync_end(rs->num_dirty_pages_period); |