savevm.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * QEMU save vm functions
  3. *
  4. * Copyright (c) 2003-2008 Fabrice Bellard
  5. * Copyright (c) 2009-2017 Red Hat Inc
  6. *
  7. * Authors:
  8. * Juan Quintela <quintela@redhat.com>
  9. *
  10. * This work is licensed under the terms of the GNU GPL, version 2 or later.
  11. * See the COPYING file in the top-level directory.
  12. */
  13. #ifndef MIGRATION_SAVEVM_H
  14. #define MIGRATION_SAVEVM_H
  15. #define QEMU_VM_FILE_MAGIC 0x5145564d
  16. #define QEMU_VM_FILE_VERSION_COMPAT 0x00000002
  17. #define QEMU_VM_FILE_VERSION 0x00000003
  18. #define QEMU_VM_EOF 0x00
  19. #define QEMU_VM_SECTION_START 0x01
  20. #define QEMU_VM_SECTION_PART 0x02
  21. #define QEMU_VM_SECTION_END 0x03
  22. #define QEMU_VM_SECTION_FULL 0x04
  23. #define QEMU_VM_SUBSECTION 0x05
  24. #define QEMU_VM_VMDESCRIPTION 0x06
  25. #define QEMU_VM_CONFIGURATION 0x07
  26. #define QEMU_VM_COMMAND 0x08
  27. #define QEMU_VM_SECTION_FOOTER 0x7e
  28. bool qemu_savevm_state_blocked(Error **errp);
  29. void qemu_savevm_non_migratable_list(strList **reasons);
  30. void qemu_savevm_state_setup(QEMUFile *f);
  31. bool qemu_savevm_state_guest_unplug_pending(void);
  32. int qemu_savevm_state_resume_prepare(MigrationState *s);
  33. void qemu_savevm_state_header(QEMUFile *f);
  34. int qemu_savevm_state_iterate(QEMUFile *f, bool postcopy);
  35. void qemu_savevm_state_cleanup(void);
  36. void qemu_savevm_state_complete_postcopy(QEMUFile *f);
  37. int qemu_savevm_state_complete_precopy(QEMUFile *f, bool iterable_only,
  38. bool inactivate_disks);
  39. void qemu_savevm_state_pending_exact(uint64_t *must_precopy,
  40. uint64_t *can_postcopy);
  41. void qemu_savevm_state_pending_estimate(uint64_t *must_precopy,
  42. uint64_t *can_postcopy);
  43. void qemu_savevm_send_ping(QEMUFile *f, uint32_t value);
  44. void qemu_savevm_send_open_return_path(QEMUFile *f);
  45. int qemu_savevm_send_packaged(QEMUFile *f, const uint8_t *buf, size_t len);
  46. void qemu_savevm_send_postcopy_advise(QEMUFile *f);
  47. void qemu_savevm_send_postcopy_listen(QEMUFile *f);
  48. void qemu_savevm_send_postcopy_run(QEMUFile *f);
  49. void qemu_savevm_send_postcopy_resume(QEMUFile *f);
  50. void qemu_savevm_send_recv_bitmap(QEMUFile *f, char *block_name);
  51. void qemu_savevm_send_postcopy_ram_discard(QEMUFile *f, const char *name,
  52. uint16_t len,
  53. uint64_t *start_list,
  54. uint64_t *length_list);
  55. void qemu_savevm_send_colo_enable(QEMUFile *f);
  56. void qemu_savevm_live_state(QEMUFile *f);
  57. int qemu_save_device_state(QEMUFile *f);
  58. int qemu_loadvm_state(QEMUFile *f);
  59. void qemu_loadvm_state_cleanup(void);
  60. int qemu_loadvm_state_main(QEMUFile *f, MigrationIncomingState *mis);
  61. int qemu_load_device_state(QEMUFile *f);
  62. int qemu_savevm_state_complete_precopy_non_iterable(QEMUFile *f,
  63. bool in_postcopy, bool inactivate_disks);
  64. #endif