xref: /openbmc/qemu/include/migration/misc.h (revision c4b63b7c)
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 
177b1e1a22SJuan Quintela /* migration/ram.c */
187b1e1a22SJuan Quintela 
197b1e1a22SJuan Quintela void ram_mig_init(void);
207b1e1a22SJuan Quintela 
212c9e6fecSJuan Quintela /* migration/block.c */
222c9e6fecSJuan Quintela 
232c9e6fecSJuan Quintela #ifdef CONFIG_LIVE_BLOCK_MIGRATION
242c9e6fecSJuan Quintela void blk_mig_init(void);
252c9e6fecSJuan Quintela #else
262c9e6fecSJuan Quintela static inline void blk_mig_init(void) {}
272c9e6fecSJuan Quintela #endif
282c9e6fecSJuan Quintela 
29f8d806c9SJuan Quintela #define SELF_ANNOUNCE_ROUNDS 5
30f8d806c9SJuan Quintela 
31f8d806c9SJuan Quintela static inline
32f8d806c9SJuan Quintela int64_t self_announce_delay(int round)
33f8d806c9SJuan Quintela {
34f8d806c9SJuan Quintela     assert(round < SELF_ANNOUNCE_ROUNDS && round > 0);
35f8d806c9SJuan Quintela     /* delay 50ms, 150ms, 250ms, ... */
36f8d806c9SJuan Quintela     return 50 + (SELF_ANNOUNCE_ROUNDS - round - 1) * 100;
37f8d806c9SJuan Quintela }
38f8d806c9SJuan Quintela 
39b7722747SJuan Quintela /* migration/savevm.c */
40b7722747SJuan Quintela 
41b7722747SJuan Quintela void dump_vmstate_json_to_file(FILE *out_fp);
42*c4b63b7cSJuan Quintela void savevm_skip_section_footers(void);
43*c4b63b7cSJuan Quintela void savevm_skip_configuration(void);
44b7722747SJuan Quintela 
45*c4b63b7cSJuan Quintela /* migration/migration.c */
46*c4b63b7cSJuan Quintela void qemu_start_incoming_migration(const char *uri, Error **errp);
47*c4b63b7cSJuan Quintela bool migration_is_idle(void);
48*c4b63b7cSJuan Quintela void add_migration_state_change_notifier(Notifier *notify);
49*c4b63b7cSJuan Quintela void remove_migration_state_change_notifier(Notifier *notify);
50*c4b63b7cSJuan Quintela bool migration_in_setup(MigrationState *);
51*c4b63b7cSJuan Quintela bool migration_has_finished(MigrationState *);
52*c4b63b7cSJuan Quintela bool migration_has_failed(MigrationState *);
53*c4b63b7cSJuan Quintela /* ...and after the device transmission */
54*c4b63b7cSJuan Quintela bool migration_in_postcopy_after_devices(MigrationState *);
557b1e1a22SJuan Quintela #endif
56