summary refs log tree commit diff stats
path: root/migration/ram.c
diff options
context:
space:
mode:
authorFabiano Rosas <farosas@suse.de>2024-03-11 18:00:10 +0000
committerPeter Xu <peterx@redhat.com>2024-03-11 16:56:52 -0400
commitc3cdf3fb18e5ecf8a3b4dc7223ddbfc53c418eb8 (patch)
tree5339705640fded940322e74150bac9010a10c3a7 /migration/ram.c
parent44fe138edc0f08b8568fe4ee90be6a2a56c67daf (diff)
downloadfocaccia-qemu-c3cdf3fb18e5ecf8a3b4dc7223ddbfc53c418eb8.tar.gz
focaccia-qemu-c3cdf3fb18e5ecf8a3b4dc7223ddbfc53c418eb8.zip
migration/multifd: Allow clearing of the file_bmap from multifd
We currently only need to clear the mapped-ram file bitmap from the
migration thread during save_zero_page.

We're about to add support for zero page detection on the multifd
thread, so allow ramblock_set_file_bmap_atomic() to also clear the
bits.

Signed-off-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/r/20240311180015.3359271-3-hao.xiang@linux.dev
Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'migration/ram.c')
-rw-r--r--migration/ram.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/migration/ram.c b/migration/ram.c
index 3ee8cb47d3..dec2e73f8e 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -3149,9 +3149,13 @@ static void ram_save_file_bmap(QEMUFile *f)
     }
 }
 
-void ramblock_set_file_bmap_atomic(RAMBlock *block, ram_addr_t offset)
+void ramblock_set_file_bmap_atomic(RAMBlock *block, ram_addr_t offset, bool set)
 {
-    set_bit_atomic(offset >> TARGET_PAGE_BITS, block->file_bmap);
+    if (set) {
+        set_bit_atomic(offset >> TARGET_PAGE_BITS, block->file_bmap);
+    } else {
+        clear_bit_atomic(offset >> TARGET_PAGE_BITS, block->file_bmap);
+    }
 }
 
 /**