2017-04-20 15:48:46 +03:00
|
|
|
/*
|
|
|
|
* QEMU save vm functions
|
|
|
|
*
|
|
|
|
* Copyright (c) 2003-2008 Fabrice Bellard
|
|
|
|
* Copyright (c) 2009-2017 Red Hat Inc
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Juan Quintela <quintela@redhat.com>
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
|
|
* See the COPYING file in the top-level directory.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MIGRATION_SAVEVM_H
|
|
|
|
#define MIGRATION_SAVEVM_H
|
|
|
|
|
2017-04-24 18:36:46 +03:00
|
|
|
#define QEMU_VM_FILE_MAGIC 0x5145564d
|
|
|
|
#define QEMU_VM_FILE_VERSION_COMPAT 0x00000002
|
|
|
|
#define QEMU_VM_FILE_VERSION 0x00000003
|
|
|
|
|
|
|
|
#define QEMU_VM_EOF 0x00
|
|
|
|
#define QEMU_VM_SECTION_START 0x01
|
|
|
|
#define QEMU_VM_SECTION_PART 0x02
|
|
|
|
#define QEMU_VM_SECTION_END 0x03
|
|
|
|
#define QEMU_VM_SECTION_FULL 0x04
|
|
|
|
#define QEMU_VM_SUBSECTION 0x05
|
|
|
|
#define QEMU_VM_VMDESCRIPTION 0x06
|
|
|
|
#define QEMU_VM_CONFIGURATION 0x07
|
|
|
|
#define QEMU_VM_COMMAND 0x08
|
|
|
|
#define QEMU_VM_SECTION_FOOTER 0x7e
|
|
|
|
|
2017-04-20 15:48:46 +03:00
|
|
|
bool qemu_savevm_state_blocked(Error **errp);
|
2021-02-02 16:55:21 +03:00
|
|
|
void qemu_savevm_non_migratable_list(strList **reasons);
|
2023-09-06 18:08:51 +03:00
|
|
|
int qemu_savevm_state_prepare(Error **errp);
|
2024-03-20 09:49:02 +03:00
|
|
|
int qemu_savevm_state_setup(QEMUFile *f, Error **errp);
|
2019-10-29 14:49:02 +03:00
|
|
|
bool qemu_savevm_state_guest_unplug_pending(void);
|
2018-05-02 13:47:31 +03:00
|
|
|
int qemu_savevm_state_resume_prepare(MigrationState *s);
|
2017-04-20 15:48:46 +03:00
|
|
|
void qemu_savevm_state_header(QEMUFile *f);
|
|
|
|
int qemu_savevm_state_iterate(QEMUFile *f, bool postcopy);
|
|
|
|
void qemu_savevm_state_cleanup(void);
|
|
|
|
void qemu_savevm_state_complete_postcopy(QEMUFile *f);
|
2017-06-16 19:06:58 +03:00
|
|
|
int qemu_savevm_state_complete_precopy(QEMUFile *f, bool iterable_only,
|
|
|
|
bool inactivate_disks);
|
2023-02-08 16:48:02 +03:00
|
|
|
void qemu_savevm_state_pending_exact(uint64_t *must_precopy,
|
|
|
|
uint64_t *can_postcopy);
|
|
|
|
void qemu_savevm_state_pending_estimate(uint64_t *must_precopy,
|
|
|
|
uint64_t *can_postcopy);
|
2017-04-20 15:48:46 +03:00
|
|
|
void qemu_savevm_send_ping(QEMUFile *f, uint32_t value);
|
|
|
|
void qemu_savevm_send_open_return_path(QEMUFile *f);
|
|
|
|
int qemu_savevm_send_packaged(QEMUFile *f, const uint8_t *buf, size_t len);
|
|
|
|
void qemu_savevm_send_postcopy_advise(QEMUFile *f);
|
|
|
|
void qemu_savevm_send_postcopy_listen(QEMUFile *f);
|
|
|
|
void qemu_savevm_send_postcopy_run(QEMUFile *f);
|
2018-05-02 13:47:29 +03:00
|
|
|
void qemu_savevm_send_postcopy_resume(QEMUFile *f);
|
2018-05-02 13:47:27 +03:00
|
|
|
void qemu_savevm_send_recv_bitmap(QEMUFile *f, char *block_name);
|
2017-04-20 15:48:46 +03:00
|
|
|
|
|
|
|
void qemu_savevm_send_postcopy_ram_discard(QEMUFile *f, const char *name,
|
|
|
|
uint16_t len,
|
|
|
|
uint64_t *start_list,
|
|
|
|
uint64_t *length_list);
|
2018-09-03 07:38:47 +03:00
|
|
|
void qemu_savevm_send_colo_enable(QEMUFile *f);
|
2018-09-03 07:38:54 +03:00
|
|
|
void qemu_savevm_live_state(QEMUFile *f);
|
|
|
|
int qemu_save_device_state(QEMUFile *f);
|
2017-04-20 15:48:46 +03:00
|
|
|
|
|
|
|
int qemu_loadvm_state(QEMUFile *f);
|
2017-06-28 12:52:26 +03:00
|
|
|
void qemu_loadvm_state_cleanup(void);
|
2018-09-03 07:38:54 +03:00
|
|
|
int qemu_loadvm_state_main(QEMUFile *f, MigrationIncomingState *mis);
|
|
|
|
int qemu_load_device_state(QEMUFile *f);
|
2023-06-21 14:11:55 +03:00
|
|
|
int qemu_loadvm_approve_switchover(void);
|
2021-01-29 13:14:06 +03:00
|
|
|
int qemu_savevm_state_complete_precopy_non_iterable(QEMUFile *f,
|
|
|
|
bool in_postcopy, bool inactivate_disks);
|
2017-04-20 15:48:46 +03:00
|
|
|
|
|
|
|
#endif
|