From: "Dr. David Alan Gilbert" <dgilb...@redhat.com> Add a migration flags field to each RAMBlock so that the migration code can hold a set of private flags on the RAMBlock. Add accessors.
Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> --- exec.c | 10 ++++++++++ include/exec/cpu-common.h | 2 ++ include/exec/ram_addr.h | 2 ++ 3 files changed, 14 insertions(+) diff --git a/exec.c b/exec.c index 42ad1eaedd..69fc5c9b07 100644 --- a/exec.c +++ b/exec.c @@ -1741,6 +1741,16 @@ size_t qemu_ram_pagesize_largest(void) return largest; } +uint32_t qemu_ram_get_migration_flags(const RAMBlock *rb) +{ + return rb->migration_flags; +} + +void qemu_ram_set_migration_flags(RAMBlock *rb, uint32_t flags) +{ + rb->migration_flags = flags; +} + static int memory_try_enable_merging(void *addr, size_t len) { if (!machine_mem_merge(current_machine)) { diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index 4d45a72ea9..4af179b543 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -72,6 +72,8 @@ const char *qemu_ram_get_idstr(RAMBlock *rb); bool qemu_ram_is_shared(RAMBlock *rb); size_t qemu_ram_pagesize(RAMBlock *block); size_t qemu_ram_pagesize_largest(void); +void qemu_ram_set_migration_flags(RAMBlock *rb, uint32_t flags); +uint32_t qemu_ram_get_migration_flags(const RAMBlock *rb); void cpu_physical_memory_rw(hwaddr addr, uint8_t *buf, int len, int is_write); diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h index af5bf26080..0cb6c5cb73 100644 --- a/include/exec/ram_addr.h +++ b/include/exec/ram_addr.h @@ -32,6 +32,8 @@ struct RAMBlock { ram_addr_t max_length; void (*resized)(const char*, uint64_t length, void *host); uint32_t flags; + /* These flags are owned by migration, initialised to 0 */ + uint32_t migration_flags; /* Protected by iothread lock. */ char idstr[256]; /* RCU-enabled, writes protected by the ramlist lock */ -- 2.13.0