2 * RDMA protocol and interfaces
4 * Copyright IBM, Corp. 2010-2013
5 * Copyright Red Hat, Inc. 2015-2016
8 * Michael R. Hines <mrhines@us.ibm.com>
9 * Jiuxing Liu <jl@us.ibm.com>
10 * Daniel P. Berrange <berrange@redhat.com>
12 * This work is licensed under the terms of the GNU GPL, version 2 or
13 * later. See the COPYING file in the top-level directory.
17 #ifndef QEMU_MIGRATION_RDMA_H
18 #define QEMU_MIGRATION_RDMA_H
20 #include "exec/memory.h"
22 void rdma_start_outgoing_migration(void *opaque
, const char *host_port
,
25 void rdma_start_incoming_migration(const char *host_port
, Error
**errp
);
28 * Constants used by rdma return codes
30 #define RAM_CONTROL_SETUP 0
31 #define RAM_CONTROL_ROUND 1
32 #define RAM_CONTROL_FINISH 3
35 * Whenever this is found in the data stream, the flags
36 * will be passed to rdma functions in the incoming-migration
39 #define RAM_SAVE_FLAG_HOOK 0x80
41 #define RAM_SAVE_CONTROL_NOT_SUPP -1000
42 #define RAM_SAVE_CONTROL_DELAYED -2000
45 int qemu_rdma_registration_handle(QEMUFile
*f
);
46 int qemu_rdma_registration_start(QEMUFile
*f
, uint64_t flags
);
47 int qemu_rdma_registration_stop(QEMUFile
*f
, uint64_t flags
);
48 int rdma_block_notification_handle(QEMUFile
*f
, const char *name
);
49 int rdma_control_save_page(QEMUFile
*f
, ram_addr_t block_offset
,
50 ram_addr_t offset
, size_t size
);
53 int qemu_rdma_registration_handle(QEMUFile
*f
) { return 0; }
55 int qemu_rdma_registration_start(QEMUFile
*f
, uint64_t flags
) { return 0; }
57 int qemu_rdma_registration_stop(QEMUFile
*f
, uint64_t flags
) { return 0; }
59 int rdma_block_notification_handle(QEMUFile
*f
, const char *name
) { return 0; }
61 int rdma_control_save_page(QEMUFile
*f
, ram_addr_t block_offset
,
62 ram_addr_t offset
, size_t size
)
64 return RAM_SAVE_CONTROL_NOT_SUPP
;