]>
Commit | Line | Data |
---|---|---|
e1a3ecee JQ |
1 | /* |
2 | * RDMA protocol and interfaces | |
3 | * | |
4 | * Copyright IBM, Corp. 2010-2013 | |
5 | * Copyright Red Hat, Inc. 2015-2016 | |
6 | * | |
7 | * Authors: | |
8 | * Michael R. Hines <mrhines@us.ibm.com> | |
9 | * Jiuxing Liu <jl@us.ibm.com> | |
10 | * Daniel P. Berrange <berrange@redhat.com> | |
11 | * | |
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. | |
14 | * | |
15 | */ | |
16 | ||
3fa9642f HG |
17 | #include "qemu/sockets.h" |
18 | ||
e1a3ecee JQ |
19 | #ifndef QEMU_MIGRATION_RDMA_H |
20 | #define QEMU_MIGRATION_RDMA_H | |
21 | ||
e493008d JQ |
22 | #include "exec/memory.h" |
23 | ||
3fa9642f | 24 | void rdma_start_outgoing_migration(void *opaque, InetSocketAddress *host_port, |
e1a3ecee JQ |
25 | Error **errp); |
26 | ||
3fa9642f | 27 | void rdma_start_incoming_migration(InetSocketAddress *host_port, Error **errp); |
e1a3ecee | 28 | |
10cb3336 JQ |
29 | /* |
30 | * Constants used by rdma return codes | |
31 | */ | |
32 | #define RAM_CONTROL_SETUP 0 | |
33 | #define RAM_CONTROL_ROUND 1 | |
34 | #define RAM_CONTROL_FINISH 3 | |
35 | ||
36 | /* | |
37 | * Whenever this is found in the data stream, the flags | |
38 | * will be passed to rdma functions in the incoming-migration | |
39 | * side. | |
40 | */ | |
41 | #define RAM_SAVE_FLAG_HOOK 0x80 | |
42 | ||
43 | #define RAM_SAVE_CONTROL_NOT_SUPP -1000 | |
44 | #define RAM_SAVE_CONTROL_DELAYED -2000 | |
48408174 JQ |
45 | |
46 | #ifdef CONFIG_RDMA | |
b1b38387 JQ |
47 | int rdma_registration_handle(QEMUFile *f); |
48 | int rdma_registration_start(QEMUFile *f, uint64_t flags); | |
49 | int rdma_registration_stop(QEMUFile *f, uint64_t flags); | |
a6323300 | 50 | int rdma_block_notification_handle(QEMUFile *f, const char *name); |
e493008d JQ |
51 | int rdma_control_save_page(QEMUFile *f, ram_addr_t block_offset, |
52 | ram_addr_t offset, size_t size); | |
48408174 JQ |
53 | #else |
54 | static inline | |
b1b38387 | 55 | int rdma_registration_handle(QEMUFile *f) { return 0; } |
f6d6c089 | 56 | static inline |
b1b38387 | 57 | int rdma_registration_start(QEMUFile *f, uint64_t flags) { return 0; } |
5f5b8858 | 58 | static inline |
b1b38387 | 59 | int rdma_registration_stop(QEMUFile *f, uint64_t flags) { return 0; } |
a6323300 JQ |
60 | static inline |
61 | int rdma_block_notification_handle(QEMUFile *f, const char *name) { return 0; } | |
e493008d JQ |
62 | static inline |
63 | int rdma_control_save_page(QEMUFile *f, ram_addr_t block_offset, | |
64 | ram_addr_t offset, size_t size) | |
65 | { | |
66 | return RAM_SAVE_CONTROL_NOT_SUPP; | |
67 | } | |
48408174 | 68 | #endif |
e1a3ecee | 69 | #endif |