aboutsummaryrefslogtreecommitdiff
path: root/migration/multifd.h
diff options
context:
space:
mode:
authorFabiano Rosas <farosas@suse.de>2024-08-27 14:45:53 -0300
committerFabiano Rosas <farosas@suse.de>2024-09-03 16:24:35 -0300
commit0e427da096d46860c2a5755295d1e05647e90154 (patch)
tree27814584a7cdd4cd2b887b22fac95401e1ef41bc /migration/multifd.h
parentaddd7d15816f2ee65911d30a38357cc2004f22eb (diff)
migration/multifd: Make MultiFDPages_t:offset a flexible array member
We're about to use MultiFDPages_t from inside the MultiFDSendData payload union, which means we cannot have pointers to allocated data inside the pages structure, otherwise we'd lose the reference to that memory once another payload type touches the union. Move the offset array into the end of the structure and turn it into a flexible array member, so it is allocated along with the rest of MultiFDSendData in the next patches. Note that other pointers, such as the ramblock pointer are still fine as long as the storage for them is not owned by the migration code and can be correctly released at some point. Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Fabiano Rosas <farosas@suse.de>
Diffstat (limited to 'migration/multifd.h')
-rw-r--r--migration/multifd.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/migration/multifd.h b/migration/multifd.h
index 7bb4a2cbc4..a7fdd97f70 100644
--- a/migration/multifd.h
+++ b/migration/multifd.h
@@ -77,9 +77,9 @@ typedef struct {
uint32_t num;
/* number of normal pages */
uint32_t normal_num;
- /* offset of each page */
- ram_addr_t *offset;
RAMBlock *block;
+ /* offset of each page */
+ ram_addr_t offset[];
} MultiFDPages_t;
struct MultiFDRecvData {