2017-04-17 21:32:36 +03:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QEMU_MIGRATION_RDMA_H
|
|
|
|
#define QEMU_MIGRATION_RDMA_H
|
|
|
|
|
2023-10-11 23:35:20 +03:00
|
|
|
#include "exec/memory.h"
|
|
|
|
|
2017-04-17 21:32:36 +03:00
|
|
|
void rdma_start_outgoing_migration(void *opaque, const char *host_port,
|
|
|
|
Error **errp);
|
|
|
|
|
|
|
|
void rdma_start_incoming_migration(const char *host_port, Error **errp);
|
|
|
|
|
2023-10-11 23:35:22 +03:00
|
|
|
/*
|
|
|
|
* Constants used by rdma return codes
|
|
|
|
*/
|
|
|
|
#define RAM_CONTROL_SETUP 0
|
|
|
|
#define RAM_CONTROL_ROUND 1
|
|
|
|
#define RAM_CONTROL_FINISH 3
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Whenever this is found in the data stream, the flags
|
|
|
|
* will be passed to rdma functions in the incoming-migration
|
|
|
|
* side.
|
|
|
|
*/
|
|
|
|
#define RAM_SAVE_FLAG_HOOK 0x80
|
|
|
|
|
|
|
|
#define RAM_SAVE_CONTROL_NOT_SUPP -1000
|
|
|
|
#define RAM_SAVE_CONTROL_DELAYED -2000
|
2023-10-11 23:35:16 +03:00
|
|
|
|
|
|
|
#ifdef CONFIG_RDMA
|
2023-10-11 23:35:23 +03:00
|
|
|
int rdma_registration_handle(QEMUFile *f);
|
|
|
|
int rdma_registration_start(QEMUFile *f, uint64_t flags);
|
|
|
|
int rdma_registration_stop(QEMUFile *f, uint64_t flags);
|
2023-10-11 23:35:19 +03:00
|
|
|
int rdma_block_notification_handle(QEMUFile *f, const char *name);
|
2023-10-11 23:35:20 +03:00
|
|
|
int rdma_control_save_page(QEMUFile *f, ram_addr_t block_offset,
|
|
|
|
ram_addr_t offset, size_t size);
|
2023-10-11 23:35:16 +03:00
|
|
|
#else
|
|
|
|
static inline
|
2023-10-11 23:35:23 +03:00
|
|
|
int rdma_registration_handle(QEMUFile *f) { return 0; }
|
2023-10-11 23:35:18 +03:00
|
|
|
static inline
|
2023-10-11 23:35:23 +03:00
|
|
|
int rdma_registration_start(QEMUFile *f, uint64_t flags) { return 0; }
|
2023-10-11 23:35:17 +03:00
|
|
|
static inline
|
2023-10-11 23:35:23 +03:00
|
|
|
int rdma_registration_stop(QEMUFile *f, uint64_t flags) { return 0; }
|
2023-10-11 23:35:19 +03:00
|
|
|
static inline
|
|
|
|
int rdma_block_notification_handle(QEMUFile *f, const char *name) { return 0; }
|
2023-10-11 23:35:20 +03:00
|
|
|
static inline
|
|
|
|
int rdma_control_save_page(QEMUFile *f, ram_addr_t block_offset,
|
|
|
|
ram_addr_t offset, size_t size)
|
|
|
|
{
|
|
|
|
return RAM_SAVE_CONTROL_NOT_SUPP;
|
|
|
|
}
|
2023-10-11 23:35:16 +03:00
|
|
|
#endif
|
2017-04-17 21:32:36 +03:00
|
|
|
#endif
|