xref: /openbmc/qemu/include/migration/misc.h (revision 3df663e5)
17b1e1a22SJuan Quintela /*
27b1e1a22SJuan Quintela  * QEMU migration miscellaneus exported functions
37b1e1a22SJuan Quintela  *
47b1e1a22SJuan Quintela  * Copyright IBM, Corp. 2008
57b1e1a22SJuan Quintela  *
67b1e1a22SJuan Quintela  * Authors:
77b1e1a22SJuan Quintela  *  Anthony Liguori   <aliguori@us.ibm.com>
87b1e1a22SJuan Quintela  *
97b1e1a22SJuan Quintela  * This work is licensed under the terms of the GNU GPL, version 2.  See
107b1e1a22SJuan Quintela  * the COPYING file in the top-level directory.
117b1e1a22SJuan Quintela  *
127b1e1a22SJuan Quintela  */
137b1e1a22SJuan Quintela 
147b1e1a22SJuan Quintela #ifndef MIGRATION_MISC_H
157b1e1a22SJuan Quintela #define MIGRATION_MISC_H
167b1e1a22SJuan Quintela 
171adc1ceeSJuan Quintela #include "qemu/notify.h"
181adc1ceeSJuan Quintela 
197b1e1a22SJuan Quintela /* migration/ram.c */
207b1e1a22SJuan Quintela 
217b1e1a22SJuan Quintela void ram_mig_init(void);
227b1e1a22SJuan Quintela 
232c9e6fecSJuan Quintela /* migration/block.c */
242c9e6fecSJuan Quintela 
252c9e6fecSJuan Quintela #ifdef CONFIG_LIVE_BLOCK_MIGRATION
262c9e6fecSJuan Quintela void blk_mig_init(void);
272c9e6fecSJuan Quintela #else
282c9e6fecSJuan Quintela static inline void blk_mig_init(void) {}
292c9e6fecSJuan Quintela #endif
302c9e6fecSJuan Quintela 
31f8d806c9SJuan Quintela #define SELF_ANNOUNCE_ROUNDS 5
32f8d806c9SJuan Quintela 
33f8d806c9SJuan Quintela static inline
34f8d806c9SJuan Quintela int64_t self_announce_delay(int round)
35f8d806c9SJuan Quintela {
36f8d806c9SJuan Quintela     assert(round < SELF_ANNOUNCE_ROUNDS && round > 0);
37f8d806c9SJuan Quintela     /* delay 50ms, 150ms, 250ms, ... */
38f8d806c9SJuan Quintela     return 50 + (SELF_ANNOUNCE_ROUNDS - round - 1) * 100;
39f8d806c9SJuan Quintela }
40f8d806c9SJuan Quintela 
41b7722747SJuan Quintela /* migration/savevm.c */
42b7722747SJuan Quintela 
43b7722747SJuan Quintela void dump_vmstate_json_to_file(FILE *out_fp);
44c4b63b7cSJuan Quintela void savevm_skip_section_footers(void);
45c4b63b7cSJuan Quintela void savevm_skip_configuration(void);
46b7722747SJuan Quintela 
47c4b63b7cSJuan Quintela /* migration/migration.c */
48e5cb7e76SPeter Xu void migration_object_init(void);
49c4b63b7cSJuan Quintela void qemu_start_incoming_migration(const char *uri, Error **errp);
50c4b63b7cSJuan Quintela bool migration_is_idle(void);
51c4b63b7cSJuan Quintela void add_migration_state_change_notifier(Notifier *notify);
52c4b63b7cSJuan Quintela void remove_migration_state_change_notifier(Notifier *notify);
53c4b63b7cSJuan Quintela bool migration_in_setup(MigrationState *);
54c4b63b7cSJuan Quintela bool migration_has_finished(MigrationState *);
55c4b63b7cSJuan Quintela bool migration_has_failed(MigrationState *);
56c4b63b7cSJuan Quintela /* ...and after the device transmission */
57c4b63b7cSJuan Quintela bool migration_in_postcopy_after_devices(MigrationState *);
58*3df663e5SPeter Xu void migration_only_migratable_set(void);
59*3df663e5SPeter Xu 
607b1e1a22SJuan Quintela #endif
61