aboutsummaryrefslogtreecommitdiff
path: root/migration/rdma.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2023-10-11 22:35:16 +0200
committerJuan Quintela <quintela@redhat.com>2023-10-17 09:25:13 +0200
commit48408174a7ec7bfdc18c6d9886d0eeb20520a349 (patch)
tree3fee945f4c7e69330857b5b0f43c9f780a36e82e /migration/rdma.c
parent27fd25b0fbcbcf2546fb2cb13fd9c8fe840eef02 (diff)
downloadqemu-48408174a7ec7bfdc18c6d9886d0eeb20520a349.zip
qemu-48408174a7ec7bfdc18c6d9886d0eeb20520a349.tar.gz
qemu-48408174a7ec7bfdc18c6d9886d0eeb20520a349.tar.bz2
migration/rdma: Unfold ram_control_before_iterate()
Once there: - Remove unused data parameter - unfold it in its callers. - change all callers to call qemu_rdma_registration_start() - We need to call QIO_CHANNEL_RDMA() after we check for migrate_rdma() Reviewed-by: Li Zhijian <lizhijian@fujitsu.com> Reviewed-by: Fabiano Rosas <farosas@suse.de> Signed-off-by: Juan Quintela <quintela@redhat.com> Message-ID: <20231011203527.9061-3-quintela@redhat.com>
Diffstat (limited to 'migration/rdma.c')
-rw-r--r--migration/rdma.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/migration/rdma.c b/migration/rdma.c
index f155f3e..3d74ad6 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -3850,18 +3850,15 @@ static int rdma_load_hook(QEMUFile *f, uint64_t flags, void *data)
}
}
-static int qemu_rdma_registration_start(QEMUFile *f,
- uint64_t flags, void *data)
+int qemu_rdma_registration_start(QEMUFile *f, uint64_t flags)
{
- QIOChannelRDMA *rioc = QIO_CHANNEL_RDMA(qemu_file_get_ioc(f));
- RDMAContext *rdma;
-
- if (migration_in_postcopy()) {
+ if (!migrate_rdma() || migration_in_postcopy()) {
return 0;
}
+ QIOChannelRDMA *rioc = QIO_CHANNEL_RDMA(qemu_file_get_ioc(f));
RCU_READ_LOCK_GUARD();
- rdma = qatomic_rcu_read(&rioc->rdmaout);
+ RDMAContext *rdma = qatomic_rcu_read(&rioc->rdmaout);
if (!rdma) {
return -1;
}
@@ -4002,7 +3999,6 @@ static const QEMUFileHooks rdma_read_hooks = {
};
static const QEMUFileHooks rdma_write_hooks = {
- .before_ram_iterate = qemu_rdma_registration_start,
.after_ram_iterate = qemu_rdma_registration_stop,
.save_page = qemu_rdma_save_page,
};