]>
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 | |
22f00a44 | 22 | typedef struct MigrationState MigrationState; |
dc7acc61 | 23 | |
22f00a44 | 24 | struct MigrationState |
065e2813 | 25 | { |
065e2813 AL |
26 | int64_t bandwidth_limit; |
27 | QEMUFile *file; | |
28 | int fd; | |
f327aa0c | 29 | Monitor *mon; |
065e2813 | 30 | int state; |
22f00a44 JQ |
31 | int (*get_error)(MigrationState *s); |
32 | int (*close)(MigrationState *s); | |
33 | int (*write)(MigrationState *s, const void *buff, size_t size); | |
065e2813 | 34 | void *opaque; |
3f77fc55 JQ |
35 | int blk; |
36 | int shared; | |
065e2813 AL |
37 | }; |
38 | ||
511c0231 JQ |
39 | void process_incoming_migration(QEMUFile *f); |
40 | ||
8ca5e801 | 41 | int qemu_start_incoming_migration(const char *uri); |
5bb7910a | 42 | |
b5d17adb | 43 | int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data); |
5bb7910a | 44 | |
ef4b7eee | 45 | int do_migrate_cancel(Monitor *mon, const QDict *qdict, QObject **ret_data); |
5bb7910a | 46 | |
ef4b7eee | 47 | int do_migrate_set_speed(Monitor *mon, const QDict *qdict, QObject **ret_data); |
5bb7910a | 48 | |
a0a3fd60 GC |
49 | uint64_t migrate_max_downtime(void); |
50 | ||
ef4b7eee LC |
51 | int do_migrate_set_downtime(Monitor *mon, const QDict *qdict, |
52 | QObject **ret_data); | |
2ea42952 | 53 | |
c86a6683 LC |
54 | void do_info_migrate_print(Monitor *mon, const QObject *data); |
55 | ||
56 | void do_info_migrate(Monitor *mon, QObject **ret_data); | |
5bb7910a | 57 | |
065e2813 AL |
58 | int exec_start_incoming_migration(const char *host_port); |
59 | ||
07af4452 | 60 | int exec_start_outgoing_migration(MigrationState *s, const char *host_port); |
065e2813 | 61 | |
34c9dd8e AL |
62 | int tcp_start_incoming_migration(const char *host_port); |
63 | ||
07af4452 | 64 | int tcp_start_outgoing_migration(MigrationState *s, const char *host_port); |
34c9dd8e | 65 | |
4951f65b CL |
66 | int unix_start_incoming_migration(const char *path); |
67 | ||
07af4452 | 68 | int unix_start_outgoing_migration(MigrationState *s, const char *path); |
4951f65b | 69 | |
5ac1fad3 PB |
70 | int fd_start_incoming_migration(const char *path); |
71 | ||
07af4452 | 72 | int fd_start_outgoing_migration(MigrationState *s, const char *fdname); |
5ac1fad3 | 73 | |
22f00a44 | 74 | void migrate_fd_error(MigrationState *s); |
065e2813 | 75 | |
22f00a44 | 76 | void migrate_fd_connect(MigrationState *s); |
065e2813 | 77 | |
99a0db9b GH |
78 | void add_migration_state_change_notifier(Notifier *notify); |
79 | void remove_migration_state_change_notifier(Notifier *notify); | |
afe2df69 | 80 | bool migration_is_active(MigrationState *); |
7073693b | 81 | bool migration_has_finished(MigrationState *); |
afe2df69 | 82 | bool migration_has_failed(MigrationState *); |
99a0db9b | 83 | |
adc56dda BS |
84 | uint64_t ram_bytes_remaining(void); |
85 | uint64_t ram_bytes_transferred(void); | |
86 | uint64_t ram_bytes_total(void); | |
87 | ||
88 | int ram_save_live(Monitor *mon, QEMUFile *f, int stage, void *opaque); | |
89 | int ram_load(QEMUFile *f, void *opaque, int version_id); | |
90 | ||
91 | extern int incoming_expected; | |
92 | ||
fa2756b7 AL |
93 | /** |
94 | * @migrate_add_blocker - prevent migration from proceeding | |
95 | * | |
96 | * @reason - an error to be returned whenever migration is attempted | |
97 | */ | |
98 | void migrate_add_blocker(Error *reason); | |
99 | ||
100 | /** | |
101 | * @migrate_del_blocker - remove a blocking error from migration | |
102 | * | |
103 | * @reason - the error blocking migration | |
104 | */ | |
105 | void migrate_del_blocker(Error *reason); | |
106 | ||
5bb7910a | 107 | #endif |