rdma.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. #include "qemu/sockets.h"
  17. #ifndef QEMU_MIGRATION_RDMA_H
  18. #define QEMU_MIGRATION_RDMA_H
  19. #include "exec/memory.h"
  20. void rdma_start_outgoing_migration(void *opaque, InetSocketAddress *host_port,
  21. Error **errp);
  22. void rdma_start_incoming_migration(InetSocketAddress *host_port, Error **errp);
  23. /*
  24. * Constants used by rdma return codes
  25. */
  26. #define RAM_CONTROL_SETUP 0
  27. #define RAM_CONTROL_ROUND 1
  28. #define RAM_CONTROL_FINISH 3
  29. #define RAM_SAVE_CONTROL_NOT_SUPP -1000
  30. #define RAM_SAVE_CONTROL_DELAYED -2000
  31. #ifdef CONFIG_RDMA
  32. int rdma_registration_handle(QEMUFile *f);
  33. int rdma_registration_start(QEMUFile *f, uint64_t flags);
  34. int rdma_registration_stop(QEMUFile *f, uint64_t flags);
  35. int rdma_block_notification_handle(QEMUFile *f, const char *name);
  36. int rdma_control_save_page(QEMUFile *f, ram_addr_t block_offset,
  37. ram_addr_t offset, size_t size);
  38. #else
  39. static inline
  40. int rdma_registration_handle(QEMUFile *f) { return 0; }
  41. static inline
  42. int rdma_registration_start(QEMUFile *f, uint64_t flags) { return 0; }
  43. static inline
  44. int rdma_registration_stop(QEMUFile *f, uint64_t flags) { return 0; }
  45. static inline
  46. int rdma_block_notification_handle(QEMUFile *f, const char *name) { return 0; }
  47. static inline
  48. int rdma_control_save_page(QEMUFile *f, ram_addr_t block_offset,
  49. ram_addr_t offset, size_t size)
  50. {
  51. return RAM_SAVE_CONTROL_NOT_SUPP;
  52. }
  53. #endif
  54. #endif