aboutsummaryrefslogtreecommitdiff
path: root/include/exec
diff options
context:
space:
mode:
authorSteve Sistare <steven.sistare@oracle.com>2025-02-27 06:48:01 -0800
committerFabiano Rosas <farosas@suse.de>2025-03-10 12:09:24 -0300
commit094a3dbc55df1bbd2169eaf784cb75b594a72941 (patch)
treea69d66ac646d68ba84400fbe178ca6e5ae62f909 /include/exec
parentd657a14de5d597bbfe7b54e4c4f0646f440e98ad (diff)
downloadqemu-094a3dbc55df1bbd2169eaf784cb75b594a72941.zip
qemu-094a3dbc55df1bbd2169eaf784cb75b594a72941.tar.gz
qemu-094a3dbc55df1bbd2169eaf784cb75b594a72941.tar.bz2
migration: ram block cpr blockers
Unlike cpr-reboot mode, cpr-transfer mode cannot save volatile ram blocks in the migration stream file and recreate them later, because the physical memory for the blocks is pinned and registered for vfio. Add a blocker for volatile ram blocks. Also add a blocker for RAM_GUEST_MEMFD. Preserving guest_memfd may be sufficient for CPR, but it has not been tested yet. Signed-off-by: Steve Sistare <steven.sistare@oracle.com> Reviewed-by: Fabiano Rosas <farosas@suse.de> Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com> Message-ID: <1740667681-257312-1-git-send-email-steven.sistare@oracle.com> Signed-off-by: Fabiano Rosas <farosas@suse.de>
Diffstat (limited to 'include/exec')
-rw-r--r--include/exec/memory.h3
-rw-r--r--include/exec/ramblock.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 78c4e0a..d09af58 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -3203,6 +3203,9 @@ bool ram_block_discard_is_disabled(void);
*/
bool ram_block_discard_is_required(void);
+void ram_block_add_cpr_blocker(RAMBlock *rb, Error **errp);
+void ram_block_del_cpr_blocker(RAMBlock *rb);
+
#endif
#endif
diff --git a/include/exec/ramblock.h b/include/exec/ramblock.h
index 0babd10..64484cd 100644
--- a/include/exec/ramblock.h
+++ b/include/exec/ramblock.h
@@ -39,6 +39,7 @@ struct RAMBlock {
/* RCU-enabled, writes protected by the ramlist lock */
QLIST_ENTRY(RAMBlock) next;
QLIST_HEAD(, RAMBlockNotifier) ramblock_notifiers;
+ Error *cpr_blocker;
int fd;
uint64_t fd_offset;
int guest_memfd;