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