1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef MIGRATION_SAVEVM_H
15#define MIGRATION_SAVEVM_H
16
17#define QEMU_VM_FILE_MAGIC 0x5145564d
18#define QEMU_VM_FILE_VERSION_COMPAT 0x00000002
19#define QEMU_VM_FILE_VERSION 0x00000003
20
21#define QEMU_VM_EOF 0x00
22#define QEMU_VM_SECTION_START 0x01
23#define QEMU_VM_SECTION_PART 0x02
24#define QEMU_VM_SECTION_END 0x03
25#define QEMU_VM_SECTION_FULL 0x04
26#define QEMU_VM_SUBSECTION 0x05
27#define QEMU_VM_VMDESCRIPTION 0x06
28#define QEMU_VM_CONFIGURATION 0x07
29#define QEMU_VM_COMMAND 0x08
30#define QEMU_VM_SECTION_FOOTER 0x7e
31
32bool qemu_savevm_state_blocked(Error **errp);
33void qemu_savevm_state_setup(QEMUFile *f);
34int qemu_savevm_state_resume_prepare(MigrationState *s);
35void qemu_savevm_state_header(QEMUFile *f);
36int qemu_savevm_state_iterate(QEMUFile *f, bool postcopy);
37void qemu_savevm_state_cleanup(void);
38void qemu_savevm_state_complete_postcopy(QEMUFile *f);
39int qemu_savevm_state_complete_precopy(QEMUFile *f, bool iterable_only,
40 bool inactivate_disks);
41void qemu_savevm_state_pending(QEMUFile *f, uint64_t max_size,
42 uint64_t *res_precopy_only,
43 uint64_t *res_compatible,
44 uint64_t *res_postcopy_only);
45void qemu_savevm_send_ping(QEMUFile *f, uint32_t value);
46void qemu_savevm_send_open_return_path(QEMUFile *f);
47int qemu_savevm_send_packaged(QEMUFile *f, const uint8_t *buf, size_t len);
48void qemu_savevm_send_postcopy_advise(QEMUFile *f);
49void qemu_savevm_send_postcopy_listen(QEMUFile *f);
50void qemu_savevm_send_postcopy_run(QEMUFile *f);
51void qemu_savevm_send_postcopy_resume(QEMUFile *f);
52void qemu_savevm_send_recv_bitmap(QEMUFile *f, char *block_name);
53
54void qemu_savevm_send_postcopy_ram_discard(QEMUFile *f, const char *name,
55 uint16_t len,
56 uint64_t *start_list,
57 uint64_t *length_list);
58
59int qemu_loadvm_state(QEMUFile *f);
60void qemu_loadvm_state_cleanup(void);
61
62#endif
63