diff options
author | Juan Quintela <quintela@redhat.com> | 2023-10-11 22:35:20 +0200 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2023-10-17 09:25:13 +0200 |
commit | e493008d504b3513e64f90e87924fd4b4a2f0751 (patch) | |
tree | feb2cb573bbfcb456f50779d1c048c546efc5da2 /migration/rdma.c | |
parent | a6323300e879558055948cb16ba6da52a9836869 (diff) |
migration/rdma: Create rdma_control_save_page()
The only user of ram_control_save_page() and save_page() hook was
rdma. Just move the function to rdma.c, rename it to
rdma_control_save_page().
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011203527.9061-7-quintela@redhat.com>
Diffstat (limited to 'migration/rdma.c')
-rw-r--r-- | migration/rdma.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/migration/rdma.c b/migration/rdma.c index 0b1cb03b2b..f66bd939d7 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -3314,6 +3314,24 @@ err: return -1; } +int rdma_control_save_page(QEMUFile *f, ram_addr_t block_offset, + ram_addr_t offset, size_t size) +{ + if (!migrate_rdma()) { + return RAM_SAVE_CONTROL_NOT_SUPP; + } + + int ret = qemu_rdma_save_page(f, block_offset, offset, size); + + if (ret != RAM_SAVE_CONTROL_DELAYED && + ret != RAM_SAVE_CONTROL_NOT_SUPP) { + if (ret < 0) { + qemu_file_set_error(f, ret); + } + } + return ret; +} + static void rdma_accept_incoming_migration(void *opaque); static void rdma_cm_poll_handler(void *opaque) @@ -3989,7 +4007,6 @@ static const QEMUFileHooks rdma_read_hooks = { }; static const QEMUFileHooks rdma_write_hooks = { - .save_page = qemu_rdma_save_page, }; |