qemu/migration/savevm.h
<<
>>
Prefs
   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
  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_non_migratable_list(strList **reasons);
  34int qemu_savevm_state_prepare(Error **errp);
  35int qemu_savevm_state_setup(QEMUFile *f, Error **errp);
  36bool qemu_savevm_state_guest_unplug_pending(void);
  37int qemu_savevm_state_resume_prepare(MigrationState *s);
  38void qemu_savevm_state_header(QEMUFile *f);
  39int qemu_savevm_state_iterate(QEMUFile *f, bool postcopy);
  40void qemu_savevm_state_cleanup(void);
  41void qemu_savevm_state_complete_postcopy(QEMUFile *f);
  42int qemu_savevm_state_complete_precopy(QEMUFile *f, bool iterable_only);
  43void qemu_savevm_state_pending_exact(uint64_t *must_precopy,
  44                                     uint64_t *can_postcopy);
  45void qemu_savevm_state_pending_estimate(uint64_t *must_precopy,
  46                                        uint64_t *can_postcopy);
  47int qemu_savevm_state_complete_precopy_iterable(QEMUFile *f, bool in_postcopy);
  48bool qemu_savevm_state_postcopy_prepare(QEMUFile *f, Error **errp);
  49void qemu_savevm_send_ping(QEMUFile *f, uint32_t value);
  50void qemu_savevm_send_open_return_path(QEMUFile *f);
  51int qemu_savevm_send_packaged(QEMUFile *f, const uint8_t *buf, size_t len);
  52void qemu_savevm_send_postcopy_advise(QEMUFile *f);
  53void qemu_savevm_send_postcopy_listen(QEMUFile *f);
  54void qemu_savevm_send_postcopy_run(QEMUFile *f);
  55void qemu_savevm_send_postcopy_resume(QEMUFile *f);
  56void qemu_savevm_send_recv_bitmap(QEMUFile *f, char *block_name);
  57void qemu_savevm_maybe_send_switchover_start(QEMUFile *f);
  58
  59void qemu_savevm_send_postcopy_ram_discard(QEMUFile *f, const char *name,
  60                                           uint16_t len,
  61                                           uint64_t *start_list,
  62                                           uint64_t *length_list);
  63void qemu_savevm_send_colo_enable(QEMUFile *f);
  64void qemu_savevm_live_state(QEMUFile *f);
  65int qemu_save_device_state(QEMUFile *f);
  66
  67int qemu_loadvm_state(QEMUFile *f);
  68void qemu_loadvm_state_cleanup(MigrationIncomingState *mis);
  69int qemu_loadvm_state_main(QEMUFile *f, MigrationIncomingState *mis);
  70int qemu_load_device_state(QEMUFile *f);
  71int qemu_loadvm_approve_switchover(void);
  72int qemu_savevm_state_complete_precopy_non_iterable(QEMUFile *f,
  73        bool in_postcopy);
  74
  75bool qemu_loadvm_load_state_buffer(const char *idstr, uint32_t instance_id,
  76                                   char *buf, size_t len, Error **errp);
  77
  78#endif
  79