xref: /openbmc/qemu/include/migration/misc.h (revision ee3d96ba)
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"
18*ee3d96baSDr. David Alan Gilbert #include "qapi/qapi-types-net.h"
191adc1ceeSJuan Quintela 
207b1e1a22SJuan Quintela /* migration/ram.c */
217b1e1a22SJuan Quintela 
227b1e1a22SJuan Quintela void ram_mig_init(void);
237b1e1a22SJuan Quintela 
242c9e6fecSJuan Quintela /* migration/block.c */
252c9e6fecSJuan Quintela 
262c9e6fecSJuan Quintela #ifdef CONFIG_LIVE_BLOCK_MIGRATION
272c9e6fecSJuan Quintela void blk_mig_init(void);
282c9e6fecSJuan Quintela #else
292c9e6fecSJuan Quintela static inline void blk_mig_init(void) {}
302c9e6fecSJuan Quintela #endif
312c9e6fecSJuan Quintela 
32f8d806c9SJuan Quintela #define SELF_ANNOUNCE_ROUNDS 5
33f8d806c9SJuan Quintela 
34f8d806c9SJuan Quintela static inline
35f8d806c9SJuan Quintela int64_t self_announce_delay(int round)
36f8d806c9SJuan Quintela {
37f8d806c9SJuan Quintela     assert(round < SELF_ANNOUNCE_ROUNDS && round > 0);
38f8d806c9SJuan Quintela     /* delay 50ms, 150ms, 250ms, ... */
39f8d806c9SJuan Quintela     return 50 + (SELF_ANNOUNCE_ROUNDS - round - 1) * 100;
40f8d806c9SJuan Quintela }
41f8d806c9SJuan Quintela 
42*ee3d96baSDr. David Alan Gilbert AnnounceParameters *migrate_announce_params(void);
43b7722747SJuan Quintela /* migration/savevm.c */
44b7722747SJuan Quintela 
45b7722747SJuan Quintela void dump_vmstate_json_to_file(FILE *out_fp);
46b7722747SJuan Quintela 
47c4b63b7cSJuan Quintela /* migration/migration.c */
48e5cb7e76SPeter Xu void migration_object_init(void);
491f895604SVladimir Sementsov-Ogievskiy void migration_object_finalize(void);
50c4b63b7cSJuan Quintela void qemu_start_incoming_migration(const char *uri, Error **errp);
51c4b63b7cSJuan Quintela bool migration_is_idle(void);
52c4b63b7cSJuan Quintela void add_migration_state_change_notifier(Notifier *notify);
53c4b63b7cSJuan Quintela void remove_migration_state_change_notifier(Notifier *notify);
54c4b63b7cSJuan Quintela bool migration_in_setup(MigrationState *);
55c4b63b7cSJuan Quintela bool migration_has_finished(MigrationState *);
56c4b63b7cSJuan Quintela bool migration_has_failed(MigrationState *);
57c4b63b7cSJuan Quintela /* ...and after the device transmission */
58c4b63b7cSJuan Quintela bool migration_in_postcopy_after_devices(MigrationState *);
599d18af93SPeter Xu void migration_global_dump(Monitor *mon);
603df663e5SPeter Xu 
61b35ebdf0SVladimir Sementsov-Ogievskiy /* migration/block-dirty-bitmap.c */
62b35ebdf0SVladimir Sementsov-Ogievskiy void dirty_bitmap_mig_init(void);
63b35ebdf0SVladimir Sementsov-Ogievskiy 
647b1e1a22SJuan Quintela #endif
65