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