Files
qemu-qemu-1/migration/rdma.h
Fabiano Rosas 03a680c978 migration/channel: Centralize calling migration_channel_connect_outgoing
Make the synchronous calls evident by not hiding the call to
migration_channel_connect_outgoing() in the transport code. Have those
functions return and call the function at the upper level.

This helps with navigation: the transport code returns the ioc,
there's no need to look into them when browsing the code.

It also allows RDMA in the source side to use the same path as the
rest of the transports.

While here, document the async calls which are the exception.

Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Prasad Pandit <pjp@fedoraproject.org>
Link: https://lore.kernel.org/qemu-devel/20260123141656.6765-26-farosas@suse.de
Signed-off-by: Fabiano Rosas <farosas@suse.de>
2026-01-23 11:34:25 -03:00

62 lines
1.7 KiB
C

/*
* RDMA protocol and interfaces
*
* Copyright IBM, Corp. 2010-2013
* Copyright Red Hat, Inc. 2015-2016
*
* Authors:
* Michael R. Hines <mrhines@us.ibm.com>
* Jiuxing Liu <jl@us.ibm.com>
* Daniel P. Berrange <berrange@redhat.com>
*
* This work is licensed under the terms of the GNU GPL, version 2 or
* later. See the COPYING file in the top-level directory.
*
*/
#include "qemu/sockets.h"
#ifndef QEMU_MIGRATION_RDMA_H
#define QEMU_MIGRATION_RDMA_H
#include "system/memory.h"
QIOChannel *rdma_connect_outgoing(void *opaque, InetSocketAddress *host_port,
Error **errp);
void rdma_connect_incoming(InetSocketAddress *host_port, Error **errp);
/*
* Constants used by rdma return codes
*/
#define RAM_CONTROL_SETUP 0
#define RAM_CONTROL_ROUND 1
#define RAM_CONTROL_FINISH 3
#define RAM_SAVE_CONTROL_DELAYED -2000
#ifdef CONFIG_RDMA
int rdma_registration_handle(QEMUFile *f);
int rdma_registration_start(QEMUFile *f, uint64_t flags);
int rdma_registration_stop(QEMUFile *f, uint64_t flags);
int rdma_block_notification_handle(QEMUFile *f, const char *name);
int rdma_control_save_page(QEMUFile *f, ram_addr_t block_offset,
ram_addr_t offset, size_t size);
#else
static inline
int rdma_registration_handle(QEMUFile *f) { return 0; }
static inline
int rdma_registration_start(QEMUFile *f, uint64_t flags) { return 0; }
static inline
int rdma_registration_stop(QEMUFile *f, uint64_t flags) { return 0; }
static inline
int rdma_block_notification_handle(QEMUFile *f, const char *name) { return 0; }
static inline
int rdma_control_save_page(QEMUFile *f, ram_addr_t block_offset,
ram_addr_t offset, size_t size)
{
g_assert_not_reached();
}
#endif
#endif