]>
Commit | Line | Data |
---|---|---|
5bb7910a AL |
1 | /* |
2 | * QEMU live migration | |
3 | * | |
4 | * Copyright IBM, Corp. 2008 | |
5 | * | |
6 | * Authors: | |
7 | * Anthony Liguori <[email protected]> | |
8 | * | |
9 | * This work is licensed under the terms of the GNU GPL, version 2. See | |
10 | * the COPYING file in the top-level directory. | |
11 | * | |
12 | */ | |
13 | ||
14 | #ifndef QEMU_MIGRATION_H | |
15 | #define QEMU_MIGRATION_H | |
16 | ||
f96fc8a0 | 17 | #include "qdict.h" |
376253ec | 18 | #include "qemu-common.h" |
99a0db9b | 19 | #include "notify.h" |
fa2756b7 | 20 | #include "error.h" |
376253ec | 21 | |
6607ae23 IY |
22 | struct MigrationParams { |
23 | bool blk; | |
24 | bool shared; | |
25 | }; | |
26 | ||
22f00a44 | 27 | typedef struct MigrationState MigrationState; |
dc7acc61 | 28 | |
22f00a44 | 29 | struct MigrationState |
065e2813 | 30 | { |
065e2813 AL |
31 | int64_t bandwidth_limit; |
32 | QEMUFile *file; | |
33 | int fd; | |
065e2813 | 34 | int state; |
22f00a44 JQ |
35 | int (*get_error)(MigrationState *s); |
36 | int (*close)(MigrationState *s); | |
37 | int (*write)(MigrationState *s, const void *buff, size_t size); | |
065e2813 | 38 | void *opaque; |
6607ae23 | 39 | MigrationParams params; |
065e2813 AL |
40 | }; |
41 | ||
511c0231 JQ |
42 | void process_incoming_migration(QEMUFile *f); |
43 | ||
d5c5dacc | 44 | int qemu_start_incoming_migration(const char *uri, Error **errp); |
5bb7910a | 45 | |
a0a3fd60 GC |
46 | uint64_t migrate_max_downtime(void); |
47 | ||
c86a6683 LC |
48 | void do_info_migrate_print(Monitor *mon, const QObject *data); |
49 | ||
50 | void do_info_migrate(Monitor *mon, QObject **ret_data); | |
5bb7910a | 51 | |
065e2813 AL |
52 | int exec_start_incoming_migration(const char *host_port); |
53 | ||
07af4452 | 54 | int exec_start_outgoing_migration(MigrationState *s, const char *host_port); |
065e2813 | 55 | |
d5c5dacc | 56 | int tcp_start_incoming_migration(const char *host_port, Error **errp); |
34c9dd8e | 57 | |
d5c5dacc AK |
58 | int tcp_start_outgoing_migration(MigrationState *s, const char *host_port, |
59 | Error **errp); | |
34c9dd8e | 60 | |
4951f65b CL |
61 | int unix_start_incoming_migration(const char *path); |
62 | ||
07af4452 | 63 | int unix_start_outgoing_migration(MigrationState *s, const char *path); |
4951f65b | 64 | |
5ac1fad3 PB |
65 | int fd_start_incoming_migration(const char *path); |
66 | ||
07af4452 | 67 | int fd_start_outgoing_migration(MigrationState *s, const char *fdname); |
5ac1fad3 | 68 | |
22f00a44 | 69 | void migrate_fd_error(MigrationState *s); |
065e2813 | 70 | |
22f00a44 | 71 | void migrate_fd_connect(MigrationState *s); |
065e2813 | 72 | |
99a0db9b GH |
73 | void add_migration_state_change_notifier(Notifier *notify); |
74 | void remove_migration_state_change_notifier(Notifier *notify); | |
afe2df69 | 75 | bool migration_is_active(MigrationState *); |
7073693b | 76 | bool migration_has_finished(MigrationState *); |
afe2df69 | 77 | bool migration_has_failed(MigrationState *); |
99a0db9b | 78 | |
adc56dda BS |
79 | uint64_t ram_bytes_remaining(void); |
80 | uint64_t ram_bytes_transferred(void); | |
81 | uint64_t ram_bytes_total(void); | |
82 | ||
539de124 | 83 | int ram_save_live(QEMUFile *f, int stage, void *opaque); |
adc56dda BS |
84 | int ram_load(QEMUFile *f, void *opaque, int version_id); |
85 | ||
fa2756b7 AL |
86 | /** |
87 | * @migrate_add_blocker - prevent migration from proceeding | |
88 | * | |
89 | * @reason - an error to be returned whenever migration is attempted | |
90 | */ | |
91 | void migrate_add_blocker(Error *reason); | |
92 | ||
93 | /** | |
94 | * @migrate_del_blocker - remove a blocking error from migration | |
95 | * | |
96 | * @reason - the error blocking migration | |
97 | */ | |
98 | void migrate_del_blocker(Error *reason); | |
99 | ||
5bb7910a | 100 | #endif |